miaohua1982 / sentimentimdb Goto Github PK
View Code? Open in Web Editor NEWNLP Sentiment using different model by imdb dataset
NLP Sentiment using different model by imdb dataset
A demo for NLP sentiment by dataset imdb using pytorch framework Rightnow, I just realize 7 models: lstm, gru, fasttext, cnn, bert, adbert, transformer_enc #training command line for fasttext with max seq length=512 python main.py --train --model fast --model_path model_storage/model_fast.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --embedding_size 100 -bs 64 -d /root/myfavor/nlp/.data/imdb/aclImdb #testing command line for fasttext(0.877) python main.py --test --model fast --load_model --model_path model_storage/model_fast.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --embedding_size 100 -bs 64 -d /root/myfavor/nlp/.data/imdb/aclImdb #with bert weights it can be to 0.884 python main.py --train --model fast --model_path model_storage/model_fast.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer bert --embedding_size 768 -bs 64 -d /root/myfavor/nlp/.data/imdb/aclImdb python main.py --test --model fast --load_model --model_path model_storage/model_fast.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer bert --embedding_size 768 -bs 64 -d /root/myfavor/nlp/.data/imdb/aclImdb #training command line for cnn classifier with max seq length=512 python main.py --train --model cnn --model_path model_storage/model_cnn.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --embedding_size 100 --ff_hidden 256 -bs 64 -e 3 -d /root/data/aclImdb #testing command line for cnn classifier(0.894) python main.py --test --model cnn --load_model --model_path model_storage/model_cnn.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --embedding_size 100 --ff_hidden 256 -bs 64 -d /root/data/aclImdb #training command line lstm python main.py --train --model lstm --model_path model_storage/model_lstm.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --ff_hidden 256 --drop_out 0.5 -bs 128 --rnn_layers 2 -d /root/data/aclImdb --embedding_size 100 #testing command line for lstm(0.858) python main.py --test --model lstm --load_model --model_path model_storage/model_lstm.pth --tokenizer spacy --embedding_size 100 --ff_hidden 256 -bs 64 --rnn_layers 2 -d /root/data/aclImdb #training command line for gru python main.py --train --model gru --model_path model_storage/model_gru.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --ff_hidden 256 --drop_out 0.5 -bs 128 --rnn_layers 2 -d /root/data/aclImdb --embedding_size 100 #testing command line for gru(0.855) python main.py --test --model gru --load_model --model_path model_storage/model_gru.pth --tokenizer spacy --embedding_size 100 --ff_hidden 256 -bs 64 --rnn_layers 2 -d /root/data/aclImdb #use bert tokenizer & pretrained weights(with max seq lengths=512, batch_size=128) python main.py --train --model bert --model_path model_storage/model_bert.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer bert --embedding_size 768 --ff_hidden 256 --drop_out 0.25 -bs 128 --rnn_layers 2 -d /root/myfavor/nlp/.data -e 2 #testing command for bert(0.882) python main.py --test --model bert --model_path model_storage/model_bert.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer bert --embedding_size 768 --ff_hidden 256 --drop_out 0.25 -bs 128 --rnn_layers 2 -d /root/myfavor/nlp/.data #use torchtext for adbert python main.py --train --torchtext --model adbert --model_path model_storage/model_adbert.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer adbert --embedding_size 768 --ff_hidden 256 --drop_out 0.25 -bs 128 --rnn_layers 2 -d /root/myfavor/nlp/.data -e 3 #testing command for adbert(0.922) python main.py --test --torchtext --model adbert --load_model --model_path model_storage/model_adbert.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer adbert --embedding_size 768 --ff_hidden 256 --drop_out 0.25 -bs 128 --rnn_layers 2 -d /root/myfavor/nlp/.data #training command line for transformer_enc python main.py --train --model transformer_enc --model_path model_storage/model_transformer_enc.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --embedding_size 100 --drop_out 0.1 --cuda -e 4 --enc_layers 6 -d /root/myfavor/nlp/.data python main.py --test --model transformer_enc --model_path model_storage/model_transformer_enc.pth --tokenizer_dump_path model_storage/tokenizer_file.dmp --tokenizer spacy --embedding_size 100 --drop_out 0.1 --cuda -e 4 --enc_layers 6 -d /root/myfavor/nlp/.data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.