Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qew21/sentiment-analysis
Sentiment analysis using transformer
https://github.com/qew21/sentiment-analysis
bert-model python transformer
Last synced: 27 days ago
JSON representation
Sentiment analysis using transformer
- Host: GitHub
- URL: https://github.com/qew21/sentiment-analysis
- Owner: qew21
- Created: 2024-03-11T14:52:27.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-13T14:28:28.000Z (10 months ago)
- Last Synced: 2024-11-06T20:15:47.655Z (3 months ago)
- Topics: bert-model, python, transformer
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sentiment Analysis Using Transformer
[BERT base model (uncased)](https://huggingface.co/google-bert/bert-base-uncased)
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is uncased: it does not make a difference between english and English.
[IMDB Dataset](https://huggingface.co/datasets/imdb)
Large Movie Review Dataset. This is a dataset for binary sentiment classification containing substantially more data than previous benchmark datasets. We provide a set of 25,000 highly polar movie reviews for training, and 25,000 for testing. There is additional unlabeled data for use as well.
## Quick start
### Train
```shell
python train.py
```### Predict
```shell
python predict.py
```### Serve
```shell
python server.py
``````text
This film is terrible! predicted result: negative, predicted probability: 0.994263231754303
This film is great! predicted result: positive, predicted probability: 0.9927541613578796
This film is not terrible! predicted result: positive, predicted probability: 0.7570403218269348
This film is not great! predicted result: negative, predicted probability: 0.9897279143333435
```## Reference
- https://github.com/bentrevett/pytorch-sentiment-analysis/tree/main