[英]OSError: [E053] Could not read meta.json from model-best.zip
我試圖加載訓練有素的 spacy model 但出現此錯誤: 這是我的代碼: ...
[英]OSError: [E053] Could not read meta.json from model-best.zip
我試圖加載訓練有素的 spacy model 但出現此錯誤: 這是我的代碼: ...
[英]LSTM named entity recognition model - shape are incompatible or logits/labels have different dimensions - Tensorflow 2.9
我正在處理 NLP LSTM 命名實體提取 model 但遇到不同的錯誤,下面是有關錯誤的更多詳細信息。 我在木星筆記本中運行這段代碼 Tensorflow 版本 2.9 input 和 output 的長度都是 50 輸入句子:[123 88 170 221 132 52 105 32 211 ...
[英]Append a list of dictionaries to the value in another dictionary
我正在嘗試創建嵌套字典,因為我通過我的 NER model 循環標記 output。這是我到目前為止的代碼: 輸出: 然后我運行一個 for 循環: 這輸出: 這接近我想要的,但這是我理想的 output: 如果不將每個條目都放入不同的元組中,我將如何做到這一點? 提前致謝。 ...
[英]Error while loading spacy model from the pickle file
從 pickle 文件加載 spacy NER model 時出現以下錯誤。 運行以下代碼行時出現此錯誤: self.model = pickle.load(open(model_path, 'rb')) 我已經使用 spacy 版本 3.1.2 訓練了 NER model,最近我將 spacy 升 ...
[英]Simple NER - IndexError: string index out of range error
下面是使用Python中Natural Language Toolkit(nltk)庫中的命名實體識別工具進行命名實體識別(NER)的一個簡單例子: 導入 nltk 輸入文本 text = "Barack Obama 出生在夏威夷。他是美國第 44 任總統。" 標記文本 tokens = nltk. ...
[英]Why is the spaCy Scorer returning None for the entity scores but the model is extracting entities?
我真的很困惑為什么 Scorer.score 在下面的示例中將 ents_p、ents_r 和 ents_f 返回為 None。 我看到一些與我自己的自定義 model 相似的東西,想知道為什么它返回無? 計分器代碼示例 - 為 ents_p、ents_r、ents_f 返回 None 得分手結果 ...
[英]AttributeError: 'TokenClassifierOutput' object has no attribute 'detach'
你能幫我解決以下錯誤嗎: 'TokenClassifierOutput' object has no attribute 'detach' 即使修改代碼時錯誤仍然存在 output = model(input_ids, token_type_ids=None, attention_mask=inp ...
[英]NER - Extract long entities - voice chatbot
構建一個語音聊天機器人來完成一些特定的任務(意圖),例如翻譯, 問題是我有很長的實體: 來自用戶的輸入:“翻譯成德語 Eminem Show 20th Anniversary launched earlier this year” 我需要提取以下實體: ("德語", "LanguageTo") ...
[英]How can i add or remove labels while finetune bert ner model?
我想微調 BERT NER 模型並刪除或添加新標簽。 例如,我有這些標簽:LOCATION MONEY ORGANIZATION PERSON PRODUCT TIME TVSHOW。 我想要更多標簽或在微調時刪除標簽。 這可能嗎? 如果不是,其他解決方案是什么? 我找不到解決辦法。 ...
[英]Fine tuning Bert for NER attempt on Mac OS
我正在使用 MacBook Air/OS Monterey 12.5(有更新可用;Ventura 13.1 Python 版本 3.10.8,也嘗試使用 3.11 Pylance 指出我嘗試執行的所有導入都沒有得到解析,因此我將 VS Code 解釋器更改為 Python 3.10。 無論如何, ...
[英]spaCy model .from_disk doesn't load patterns
對於使用 spaCy 的荷蘭語命名實體識別任務,我使用 EntityRuler 添加了實體。 當我將標尺添加到筆記本中的管道時: NER 管道工作得很好。 但是,當我將它保存到我的磁盤然后再次加載這個 model 時使用 model 遺漏了通過 EntityRuler 添加的實體。 我在文檔中沒 ...
[英]Converting a dataset to CoNLL format. Label remaining tokens with O
我有一個手動注釋的數據集,其中包含以下格式的記錄:{ "id": 1, "text": "At the end of each fiscal quarter, for the four consecutive fiscal quarters ending as of such fi ...
[英]Ensuring memorization doesn't happen between between train and test sets in a Machine Learning model
這個賞金已經結束了。 此問題的答案有資格獲得+50聲望賞金。 賞金寬限期在16 小時后結束。 Arthur Lee想提請更多人關注這個問題。 最近,承包商為我們開發了一個 NER 解決方案,該解決方案從葯物政策中提取相關葯物(政策描述覆蓋標准的葯物)。 他們的部分過程是通過訓練集,並替換也出現在 ...
[英]Spacy NER: Extract all Persons before a specific word
我知道我可以使用名為 recognition 的 spacy 實體來提取文本中的人物。 但我只想提取“問”這個詞之前的人或人。 我應該將 Matcher 與 NER 一起使用嗎? 我是 Spacy 的新手,如果問題很簡單,我深表歉意所需 Output: 路易斯·吳當前Output: 路易斯·吳藍品敏 ...
[英]sklearn_crfsuite.CRF UnicodeEncodeError
python 版本:3.6 操作系統:windows 我正在嘗試使用sklearn_crfsuite.CRF和 ner_dataset 訓練中文 NER model 。 在我清理數據集並擬合 model 后,它顯示錯誤消息: 數據格式為.txt ,用\n分隔, OriginalText存儲文本數據 ...
[英]How to define ner_model in spacy
def all_ents(v): return [(ent.text, ent.label_) for ent in ner_model(v).ents] df1['Entities'] = df1['text'].apply(lambda v: all_ents(v)) df1 ...
[英]How to predict entities for multiple sentences using spaCy?
我使用 spaCy 訓練了一個 ner model。 我知道如何使用它來識別單個句子(doc 對象)的實體並可視化結果: 或者 現在我想預測多個這樣的句子的實體。 我的想法是按實體過濾句子。 目前我剛剛找到以下方法來做到這一點: 我的問題是是否有更好、更有效的方法來做到這一點? ...
[英]Should I use tok2vec before ner in spacy?
我目前正在為命名實體識別訓練 model,但我無法找到 spacy 中的管道應該如何構建才能獲得更好的結果。 在 ner 組件之前使用 tok2vec 有意義嗎? ...
[英]How many data is needed to creat useful word vectors using gensim?
我嘗試對推文進行命名實體識別 (nlp),以識別推文是否談論疾病。 為此,我目前正在嘗試在 gensim 中創建自己的 word2vec 並導入它們以在 spacy 中訓練新的 ner model。 我的問題是,需要多少數據才能為我的目的創建有用的詞向量? ...
[英]Complex Regex not working in Spacy entity ruler
我正在嘗試通過使用實體標尺將正則表達式(正則表達式)傳遞給 Spacy model 來識別實體,但是 Spacy 無法根據以下正則表達式進行識別。 但是,我在這里測試了正則表達式並且它正在工作。 模型訓練.py 我想實現這一點,對於下面的例子 預期 output: ...