chinese_ulmfit
1.0.0
การปรับแต่งโมเดลภาษาสากลสำหรับการจำแนกประเภทข้อความ
ดาวน์โหลดรุ่นที่ผ่านการฝึกอบรมมาก่อน
สร้างสภาพแวดล้อมเสมือนจริง (คุณสามารถกำหนดค่าแหล่งที่มาของ Tsinghua Conda)
conda env create -f env.ymlเปิดเครื่องซิปจีนวิกิพีเดีย
python -m gensim.scripts.segment_wiki -i -f /data/zhwiki-latest-pages-articles.xml.bz2 -o tmp/wiki2018-11-14.json.gzคำกริยาวิกิพีเดีย
python preprocessing.py segment-wiki --input_file=tmp/wiki2018-11-14.json.gz --output_file=tmp/wiki2018-11-14.words.pklวัสดุการแบ่งส่วนคำ
python preprocessing.py segment-csv --input_file=data/ch_auto.csv --output_file=tmp/ch_auto.words.pkl --label_file=tmp/ch_auto.labels.npyวัสดุวิกิพีเดียโทเค็น
python preprocessing.py tokenize --input_file=tmp/wiki2018-11-14.words.pkl --output_file=tmp/wiki2018-11-14.ids.npy --mapping_file=tmp/wiki2018-11-14.mapping.pklTokenize วัสดุภาคสนาม
python preprocessing.py tokenize --input_file=tmp/ch_auto.words.pkl --output_file=tmp/ch_auto.ids.npy --mapping_file=tmp/ch_auto.mapping.pklการฝึกอบรมล่วงหน้า
python pretraining.py --input_file=tmp/wiki2018-11-14.ids.npy --mapping_file=tmp/wiki2018-11-14.mapping.pkl --dir_path=tmpการปรับที่ดี
python finetuning.py --input_file=tmp/ch_auto.ids.npy --mapping_file=tmp/ch_auto.mapping.pkl --pretrain_model_file=tmp/models/wiki2018-11-14.h5 --pretrain_mapping_file=tmp/wiki2018-11-14.mapping.pkl --dir_path=tmp --model_id=ch_autoตัวแยกประเภทฝึกอบรม
python3 train_classifier.py --id_file=tmp/ch_auto.ids.npy --label_file=tmp/ch_auto.labels.npy --mapping_file=tmp/ch_auto.mapping.pkl --encoder_file=ch_auto_encทดสอบ
python3 predicting.py --mapping_file=tmp/ch_auto.mapping.pkl --classifier_filename=tmp/models/classifier_1.h5 --num_class=2