如何在最短时间内使用拥抱面部模型来预测2000万记录的结果
我试图使用拥抱面中可用的模型来预测2000万张记录的情感。
该模型可以在本地保存并通过加载本地访问。
任何人都可以建议我如何有效地使用它来预测最短时间的2000万个记录。
另外,我使用的是零弹性分类模型,与需要
7分钟的相同数据来预测1000个记录。
也要为此建议您在最短时间内预测。
model_path = 'path where model is saved'
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="Recognai/bert-base-spanish-wwm-cased-xnli")
def predict(row):
topics = # five candidate labels here
res = classifier(row, topics)
return res
df['Predict'] = df['Message'].apply(lambda x: predict_crash(x)) # This df contains 70k records
I am trying to predict sentiment for 20 million records using the model available in Hugging Face.
https://huggingface.co/finiteautomata/beto-sentiment-analysis
This model takes 1 hour and 20 minutes to predict 70000 records.
The model is saved locally and accessed locally by loading it.
Anyone can please suggest how I can efficiently use it to predict 20 million records in a minimum time.
Also, I am using the Zero-Shot Classification Model on the same data it is taking taking
7 minutes to predict for 1000 records.
Kindly suggest for this as well if any way to predict in minimum time.
model_path = 'path where model is saved'
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="Recognai/bert-base-spanish-wwm-cased-xnli")
def predict(row):
topics = # five candidate labels here
res = classifier(row, topics)
return res
df['Predict'] = df['Message'].apply(lambda x: predict_crash(x)) # This df contains 70k records
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论