如何在最短时间内使用拥抱面部模型来预测2000万记录的结果

发布于 2025-01-27 20:21:39 字数 875 浏览 6 评论 0原文

我试图使用拥抱面中可用的模型来预测2000万张记录的情感。

https://huggingface.co/finiteautamota/beto-sentiment-sentiment-entiment-entiment-andalyalissy 1小时20分钟以预测70000记录。

该模型可以在本地保存并通过加载本地访问。

任何人都可以建议我如何有效地使用它来预测最短时间的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文