Downloads · 30 days
12
36% of all-time downloads
dadangheksaputra/indonesia-bert-lexicon-sentiment-classification
indonesia-bert-lexicon-sentiment-classification is a machine learning model from dadangheksaputra. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
pretrained= "dadangheksaputra/indonesia-bert-lexicon-sentiment-classification" model = AutoModelForSequenceClassification.frompretrained(pretrained) tokenizer = AutoTokenizer.frompretrained(pretrained) sentimentanalys…
Downloads · 30 days
12
36% of all-time downloads
All-time downloads
33
Public
Repo size
3.1 GB
Likes
1
Public
Click a slice to open those files.
.h5656 MB · 40%
From the Hugging Face model README
pretrained= "dadangheksaputra/indonesia-bert-lexicon-sentiment-classification" model = AutoModelForSequenceClassification.from_pretrained(pretrained) tokenizer = AutoTokenizer.from_pretrained(pretrained) sentiment_analysis = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer) label_index = {'LABEL_0': 'positive', 'LABEL_1': 'neutral', 'LABEL_2': 'negative'} text = "sistem informasi aset, migrasi sistem informasi akademik" result = sentiment_analysis(neg_text) status = label_index[result[0]['label']] score = result[0]['score'] print(f'Text: {neg_text} | Label : {status} ({score * 100:.3f}%)')