https://gweissman.github.io/post/using- ... ith-python -to-access-the-umls-metathesaurus-a-quick-start-guide/
Однако, похоже, при запуске этой ячейки кода произошла ошибка:
Код: Выделить всё
cons, errs = metam.extract_concepts(note_list,
word_sense_disambiguation = True,
restrict_to_sts = ['sosy'], # signs and symptoms
composite_phrase = 1, # for memory issues
prune = 30)
Код: Выделить всё
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[66], line 1
----> 1 cons, errs = metam.extract_concepts(note_list,
2 word_sense_disambiguation = True,
3 restrict_to_sts = ['sosy'], # signs and symptoms
4 composite_phrase = 1, # for memory issues
5 prune = 30)
File ~\AppData\Local\anaconda3\Lib\site-packages\pymetamap\SubprocessBackend.py:190, in SubprocessBackend.extract_concepts(self, sentences, ids, composite_phrase, filename, file_format, allow_acronym_variants, word_sense_disambiguation, allow_large_n, strict_model, relaxed_model, allow_overmatches, allow_concept_gaps, term_processing, no_derivational_variants, derivational_variants, ignore_word_order, unique_acronym_variants, prefer_multiple_concepts, ignore_stop_phrases, compute_all_mappings, prune, mm_data_version, exclude_sources, restrict_to_sources, restrict_to_sts, exclude_sts, no_nums)
187 input_command.append('-e')
188 input_command.append(input_text)
--> 190 input_process = subprocess.Popen(input_command, stdout=subprocess.PIPE)
191 metamap_process = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=input_process.stdout)
193 output, error = metamap_process.communicate()
File ~\AppData\Local\anaconda3\Lib\subprocess.py:1026, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1022 if self.text_mode:
1023 self.stderr = io.TextIOWrapper(self.stderr,
1024 encoding=encoding, errors=errors)
-> 1026 self._execute_child(args, executable, preexec_fn, close_fds,
1027 pass_fds, cwd, env,
1028 startupinfo, creationflags, shell,
1029 p2cread, p2cwrite,
1030 c2pread, c2pwrite,
1031 errread, errwrite,
1032 restore_signals,
1033 gid, gids, uid, umask,
1034 start_new_session, process_group)
1035 except:
1036 # Cleanup if the child failed starting.
1037 for f in filter(None, (self.stdin, self.stdout, self.stderr)):
File ~\AppData\Local\anaconda3\Lib\subprocess.py:1538, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)
1536 # Start the process
1537 try:
-> 1538 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1539 # no special security
1540 None, None,
1541 int(not close_fds),
1542 creationflags,
1543 env,
1544 cwd,
1545 startupinfo)
1546 finally:
1547 # Child is launched. Close the parent's copy of those pipe
1548 # handles that only the child should have open. You need
(...)
1551 # pipe will not close when the child process exits and the
1552 # ReadFile will hang.
1553 self._close_pipe_fds(p2cread, p2cwrite,
1554 c2pread, c2pwrite,
1555 errread, errwrite)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Полезный вопрос, заданный на StackOverflow, был следующий:
FileNotFoundError: [WinError 2 ] Система не может найти указанный файл:
Однако в этом случае неизвестный файл был явно очевиден, и решение путем изменения путей было возможным. Кажется, в моей ситуации это не работает, но я могу ошибаться, так как у меня мало опыта.
Пожалуйста, сообщите - мы будем очень признательны за любые отзывы.
Подробнее здесь: https://stackoverflow.com/questions/786 ... -pymetamap