BENDeep is a pytorch based deep learning solution for Bengali NLP Task
Project description
BENDeep
BENDeep
is a pytorch based deep learning solution for Bengali NLP Task like bengali translation
, bengali sentiment analysis
and so on.
Installation
pip install bendeep
Pretrained Model
API
Sentiment Analysis
Analyzing Sentiment
This sentiment analysis model trained with more than 4000 labeled sentiment sentence with loss 0.073 at 150 epochs.
from bendeep import sentiment
model_path = "senti_trained.pt"
vocab_path = "vocab.txt"
text = "রোহিঙ্গা মুসলমানদের দুর্ভোগের অন্ত নেই।জলে কুমির ডাংগায় বাঘ।আজকে দুটি ঘটনা আমাকে ভীষণ ব্যতিত করেছে।নিরবে কিছুক্ষন অশ্রু বিসর্জন দিয়ে মনটাকে হাল্কা করার ব্যর্থ প্রয়াস চালিয়েছি।"
sentiment.analyze(model_path, vocab_path, text)
Training Sentiment Model
To train this model you need a csv file with one column review
means text and another column sentiment
with 0 or 1, where 1 for positive and 0 for negative sentiment.
review | sentiment |
---|---|
তোমাকে খুব সুন্দর লাগছে। | 1 |
আজকের আবহাওয়া খুব খারাপ। | 0 |
from bendeep import sentiment
sentiment.train(data_path)
after successfully training it will complete training and save model as trained.pt
also save vocab file as vocab.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bendeep-1.1.tar.gz
(390.4 kB
view hashes)
Built Distribution
bendeep-1.1-py3-none-any.whl
(5.9 kB
view hashes)