[英]Tensorflow 2.X Error - Op type not registered 'CaseFoldUTF8' in binary running on Colab
我使用 Tensorflow 中心的 BERT 編碼器已經有一段時間了。 以下是語法: tfhub_handle_encoder = "https://tfhub.dev/tensorflow/bert_multi_cased_L-12_H-768_A-12/4" tfhub_handle_pre ...
[英]Tensorflow 2.X Error - Op type not registered 'CaseFoldUTF8' in binary running on Colab
我使用 Tensorflow 中心的 BERT 編碼器已經有一段時間了。 以下是語法: tfhub_handle_encoder = "https://tfhub.dev/tensorflow/bert_multi_cased_L-12_H-768_A-12/4" tfhub_handle_pre ...
[英]CUDA batch out of memory
我有一個小數據集並運行一個名為 LightXML 的腳本,該腳本位於 git 上: https://github.com/kongds/LightXML 我收到此錯誤: 我發現有多個帖子說我應該減少批量大小,但我似乎找不到它的定義。 腳本停止在: one_epoch 方法如下,腳本停滯在outp ...
[英]How can i get pooled output from deberta model?
任何人都可以告訴我如何從 deberta model 匯集 output 嗎? 任何人都可以告訴我如何從 deberta model 匯集 output 嗎? 我想在不使用 *DebertaForSequenceClassification * 的情況下將它從DebertaModel用於我的分類 ...
[英]How to solve natural language inference using SentenceBERT?
如何使用微調的 SentenceBERT 模型(例如sentence-transformers/all-MiniLM-L6-v2 · Hugging Face )解決自然語言推理以獲得更好的句子向量? 其中許多模型已經使用 SNLI 等自然語言推理數據集進行了微調,但我可以使用 SNLI 再次微調 ...
[英]Doc-Classification (Pytorch, Bert), how to change the training/validation loop to work for multilabel case
我正在嘗試使BertForSequenceClassification.from_pretrained()適用於多標簽。 由於我在網上找到的代碼是針對二進制 label 的情況。 我有 12 個標簽的文檔分類。 使用 Bert 語言 model 為 pytorch model。 我應該怎么做才能使其 ...
[英]How to access BERT's inter layer?
我想將 [batch_size, 768, text_length] 張量放入 BERT 的第 6 層。 我怎樣才能給第六層輸入? 我可以只取 6~ 最后一層 BERT 然后使用它嗎? 謝謝你。 ...
[英]Is splitting a long document of a dataset for BERT considered bad practice?
我正在對標記數據集上的 BERT model 進行微調,其中許多文檔的長度超過標記器設置的 512 個標記限制。 由於截斷會丟失大量我寧願使用的數據,因此我開始尋找解決方法。 但是我注意到,從未提及在 512 個標記(或其他啟發式)之后簡單地拆分文檔並在數據集中創建具有相同 label 的新條目。 ...
[英]Generate embeddings given a string of text
我正在嘗試生成給定文本字符串的嵌入 請注意,我正在使用的文本是一大段包含超過 512 個標記的文本。 我有以下代碼: 但是,當我運行它時,出現以下錯誤: 拜托,我期待得到一個代表文本內容的嵌入。 任何幫助將不勝感激 ...
[英]BERT model convertation from DeepPavlov to HuggingFace format
我有一個包含 ruBERT model 的文件夾,它使用 Deeppavlov 庫的應用程序進行了微調。 該文件夾包含以下 model 個文件: 我如何將它轉換為 Huggingface 格式以便我可以以這種方式加載它? ...
[英]Trouble in installing BERTopic's dependency ''bertopic.dimensionality''
我正在嘗試運行BERTopic 文檔中的以下代碼: 然而,盡管在我的機器上安裝並更新了 bertopic,我還是不斷收到 output ModuleNotFoundError: No module named 'bertopic.dimensionality' 。 有沒有間斷? 或者我如何安裝ber ...
[英]How to use TPU to accelerate sentiment analysis using FinBert in Kaggle
我正在嘗試使用 FinBert 分析收益電話會議的情緒。 由於我要分析超過 40,000 次財報電話會議,因此計算情緒分數需要一周多的時間。 因此,我想使用 Kaggle 提供的 TPU 來加速這個過程。 但是我能找到的所有教程/指南都只是處理 model 的訓練,但我只想使用其中一個預訓練版本並使 ...
[英]Having trouble understanding the predictions array in classification model evaluation
我正在使用 BERT model(二進制分類)開發諷刺檢測器。 目前,我在 model 評估時遇到了問題,因為我不太了解預測數組。 model 應該 output 1 表示諷刺,0 表示不諷刺,但預測不是 output。 如果需要更多代碼,請告訴我。 謝謝! model: 評估: output ...
[英]Why is positional encoding needed while input ids already represent the order of words in Bert?
例如,在 Huggingface 的例子中: input_ids 向量已經編碼了原始句子中每個標記的順序。 為什么它需要再次用一個額外的向量來表示它的位置編碼? ...
[英]Calculate cosine similarity between 2 words using BERT
我正在嘗試使用 BERT 計算兩個給定單詞之間的余弦相似度,但我收到一條錯誤消息: 在行中: 在下面你可以找到我到目前為止使用的代碼,有人知道問題出在哪里嗎? ...
[英]Do BERT word embeddings change depending on context?
在回答“是的,當然”之前,讓我澄清一下我的意思: 訓練完 BERT 后,我想將預訓練嵌入用於其他一些 NLP 任務,我是否可以一次性從 BERT 中提取字典中所有單詞的所有單詞級嵌入,然后擁有一組 static 鍵-value word-embedding pairs,我從那里檢索比方說“bank ...
[英]FIneTunning BERT for sequence classification
我正在嘗試使用 transformers 庫微調 BERT model 以進行序列分類。 我不知道我做錯了什么,但在訓練之后(無論多少個時期)我的 model 只輸出相同的 label 對於任何可能的輸入。 我不知道我做錯了什么。 任何幫助表示贊賞。 泰。 這是我的代碼: 進口和啟動: 注意:我將 ...
[英]'BertModel' object has no attribute 'bert' error german bert model
我想復制此 repo https://github.com/theartificialguy/NLP-with-Deep-Learning/blob/master/BERT/Multi-Class%20classification%20TF-BERT/multi_class.ipynb中的工作,但 ...
[英]I am trying to make a multi label text classifier using bert, I am getting the error written below
RuntimeError:張量 a (913) 的大小必須與非單維 1 處的張量 b (512) 的大小匹配 我不明白為什么它不能使用 for 循環工作,但它在單輸入時工作正常。 ...
[英]Do I need to retrain Bert for NER to create new labels?
我對自然語言處理很陌生,我正在考慮從事命名實體識別 NER。 我的一個與 NLP 合作的朋友建議我檢查一下 BERT,我照做了。 在閱讀文檔和檢查 CoNLL-2003 數據集時,我注意到唯一的標簽是人員、組織、位置、雜項和外部。 如果我希望 model 能夠識別日期、時間和其他標簽,而不是在外部 ...
[英]PyTorch is installed. But, When I'm using BertModel, It is giving me following Import error:
我安裝並導入PyTorch 。 不過,我在使用BertModel時遇到了這個導入錯誤。 我需要一些幫助。 我得到的錯誤是: ImportError: BertModel 需要 PyTorch 庫,但在您的環境中找不到。 但是,我們能夠找到 TensorFlow 安裝。 TensorFlow 類 ...