我正在使用 owlread 构建代码,代码必须抛出文本并将医学发现转换为 SNOMED ct
import nltk
import pandas as pd
import numpy as np
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from nltk.tokenize import RegexpTokenizer
from nltk.stem import WordNetLemmatizer
import spacy
from nltk.corpus import stopwords
from nltk.classify import SklearnClassifier
from wordcloud import WordCloud, STOPWORDS
from nltk.stem import WordNetLemmatizer
import string
#pip install spacy
from spacy.lemmatizer import Lemmatizer
from spacy.lookups import Lookups
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')
import en_core_web_sm
#owlready2 and pymed
from owlready2 import *
from owlready2.pymedtermino2 import *
from owlready2.pymedtermino2.umls import *
onto = get_ontology("http://test.org/onto.owl")
#load SNOMED CT in Python
#default_world.set_backend(filename = "pym.sqlite3")
import_umls("umls-2020AB-full.zip", terminologies = ["ICD10", "SNOMEDCT_US", "CUI"])
default_world.save()
PYM = get_ontology("http://PYM/").load()
SNOMEDCT_US = PYM["SNOMEDCT_US"]
但是我收到关于 SNOMEDCT_US = PYM["SNOMEDCT_US"] 的错误,错误说 TypeError: 'NoneType' object is not subscriptable
我认为缺少可以识别 PYM["SNOMEDCT_US"] 的文件,但我仍然找不到它?
谢谢