Views
No views yet
pip install 'git+https://github.com/huggingface/transformers.git'1from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
2
3model_name = "IRI2070/tooka-bert-large-snappfood-sentiment"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForSequenceClassification.from_pretrained(model_name)
6
7nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
8
9text = "غذا خیلی خوشمزه بود و سریع رسید."
10print(nlp(text))
11# [{'label': 'HAPPY', 'score': 0.95}]