Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
ZhangbuDong 155ec304f9 | 1 year ago | |
---|---|---|
img | 1 year ago | |
README.md | 1 year ago | |
dataset.py | 1 year ago | |
env.yml | 1 year ago | |
main.py | 1 year ago | |
model.py | 1 year ago |
BERT Sentiment Analysis using huggingface.
Kaggle Sentiment Analysis on Movie Reviews training set.
Download and unzip the file, put it under data/
folder, and name it data.tsv
.
For Albert, we reduced the dataset to only keep the original sentence as input (instead of parts of the same sentence). As a result, there are only 8529 input-output pairs in the dataset we use.
# Create & activate conda environment
$ conda env create -f env.yml
$ conda activate bert-sentiment-analysis
# Train & test with default params
$ python main.py data/data.tsv output/model.pt
# Train with other settings, see help
$ python main.py -h
Albert:
BATCH_SIZE: 32
SEQ_LENGTH: 128
HIDDEN_DIM: 256
LR: 1e-06
DROPOUT: 0.2
EPOCHS: 50
LOG_INTERVAL: 10
Training set size: 6823
Test set size: 1706
Test set: Average loss: 1.3279, Accuracy: 795/1706 (47%)
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》