我尝试使用distilbert分类器。但我得到了以下错误。
这是我的代码
(X_train,y_train),(X_test,y_test),prepro
=text.texts_from_df(train_df=data_train,text_column="Cleaned",label_columns=col
,val_df=data_test,maxlen=500,preprocess_mode="distilbert")
这是错误
OSError: Model name 'distilbert-base-uncased' was not found in tokenizers model name list (distilbert-base-uncased, distilbert-base-uncased-distilled-squad, distilbert-base-cased, distilbert-base-cased-distilled-squad, distilbert-base-german-cased, distilbert-base-multilingual-cased). We assumed 'distilbert-base-uncased' was a path, a model identifier, or url to a directory containing vocabulary files named ['vocab.txt'] but couldn't find such vocabulary files at this path or url._
由于我办公室当前的环境问题,我只能在tf 2.2和python 3.8上工作。现在我使用0.19。
如果我把它降到0.16,你认为这会影响我目前的环境吗?
如果存在网络或防火墙问题,阻止下载标记器文件,则可能会发生此错误。有关补救措施,请参阅此常见问题条目。
此外,当使用preprocess_mode='distilbert'
时,texts_from*
函数返回TransformerDataset
实例,而不是数组。例如,您需要将(X_train, y_train)
替换为train_data
。请参阅此示例笔记本。