All Projects → undertheseanlp → classification

undertheseanlp / classification

Licence: GPL-3.0 license
Vietnamese Text Classification

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to classification

vietnamese-roberta
A Robustly Optimized BERT Pretraining Approach for Vietnamese
Stars: ✭ 22 (-43.59%)
Mutual labels:  vietnamese, vietnamese-nlp
automatic speech recognition
Vietnamese Automatic Speech Recognition
Stars: ✭ 58 (+48.72%)
Mutual labels:  vietnamese, vietnamese-nlp
Vietnamese-Accent-Prediction
A simple/fast/accurate accent prediction for non-accented Vietnamese text
Stars: ✭ 31 (-20.51%)
Mutual labels:  vietnamese, vietnamese-nlp
word tokenize
Vietnamese Word Tokenize
Stars: ✭ 45 (+15.38%)
Mutual labels:  vietnamese, vietnamese-nlp
Naive-Bayes-Text-Classifier-in-Java
Naive Bayes Classification used to classify movie reviews as positive or negative
Stars: ✭ 18 (-53.85%)
Mutual labels:  text-classification
Pytorch-NLU
Pytorch-NLU,一个中文文本分类、序列标注工具包,支持中文长文本、短文本的多类、多标签分类任务,支持中文命名实体识别、词性标注、分词等序列标注任务。 Ptorch NLU, a Chinese text classification and sequence annotation toolkit, supports multi class and multi label classification tasks of Chinese long text and short text, and supports sequence annotation tasks such as Chinese named entity recognition, part of speech ta…
Stars: ✭ 151 (+287.18%)
Mutual labels:  text-classification
FNet-pytorch
Unofficial implementation of Google's FNet: Mixing Tokens with Fourier Transforms
Stars: ✭ 204 (+423.08%)
Mutual labels:  text-classification
community
Ông Dev Community
Stars: ✭ 64 (+64.1%)
Mutual labels:  vietnamese
WSDM-Cup-2019
[ACM-WSDM] 3rd place solution at WSDM Cup 2019, Fake News Classification on Kaggle.
Stars: ✭ 62 (+58.97%)
Mutual labels:  text-classification
HiGRUs
Implementation of the paper "Hierarchical GRU for Utterance-level Emotion Recognition" in NAACL-2019.
Stars: ✭ 60 (+53.85%)
Mutual labels:  text-classification
nsmc-zeppelin-notebook
Movie review dataset Word2Vec & sentiment classification Zeppelin notebook
Stars: ✭ 26 (-33.33%)
Mutual labels:  text-classification
feedIO
A Feed Aggregator that Knows What You Want to Read.
Stars: ✭ 26 (-33.33%)
Mutual labels:  text-classification
10kGNAD
Ten Thousand German News Articles Dataset for Topic Classification
Stars: ✭ 63 (+61.54%)
Mutual labels:  text-classification
nlp-lt
Natural Language Processing for Lithuanian language
Stars: ✭ 17 (-56.41%)
Mutual labels:  text-classification
small-text
Active Learning for Text Classification in Python
Stars: ✭ 241 (+517.95%)
Mutual labels:  text-classification
AAAI 2019 EXAM
Official implementation of "Explicit Interaction Model towards Text Classification"
Stars: ✭ 68 (+74.36%)
Mutual labels:  text-classification
Reuters-21578-Classification
Text classification with Reuters-21578 datasets using Gensim Word2Vec and Keras LSTM
Stars: ✭ 44 (+12.82%)
Mutual labels:  text-classification
nlp classification
Implementing nlp papers relevant to classification with PyTorch, gluonnlp
Stars: ✭ 224 (+474.36%)
Mutual labels:  text-classification
yunyi
2018“云移杯- 景区口碑评价分值预测
Stars: ✭ 29 (-25.64%)
Mutual labels:  text-classification
NLP Toolkit
Library of state-of-the-art models (PyTorch) for NLP tasks
Stars: ✭ 92 (+135.9%)
Mutual labels:  text-classification

Phân loại văn bản tiếng Việt

Dự án nghiên cứu về bài toán phân loại văn bản tiếng Việt, được phát triển bởi nhóm nghiên cứu xử lý ngôn ngữ tự nhiên tiếng Việt - underthesea. Chứa mã nguồn các thử nghiệm cho việc xử lý dữ liệu, huấn luyện và đánh giá mô hình, cũng như cho phép dễ dàng tùy chỉnh mô hình đối với những tập dữ liệu mới.

Kết quả thử nghiệm

Xem thêm về mô tả dữ liệu

Kết quả các thử nghiệm kết hợp mô hình SVM và các đặc trưng Tfidf, BoW

Mô hình F1 %
TfidfVectorizer(ngram_range=(1, 2), max_df=0.5) 92.8
CountVectorizer(ngram_range=(1, 3), max_df=0.7) 89.3
TfidfVectorizer(max_df=0.8) 89.0
CountVectorizer(ngram_range=(1, 3) 88.9
TfidfVectorizer(ngram_range=(1, 3)) 86.8
CountVectorizer(max_df=0.7) 85.5

Thiết lập môi trường

Yêu cầu hệ thống

  • Hệ điều hành: Linux (Ubuntu, CentOS), Mac
  • Python 3.6+
  • conda 4+

Cài đặt

# Tải project bằng cách sử dụng lệnh `git clone`
$ git clone https://github.com/undertheseanlp/classification.git

# Tạo môi trường mới và cài đặt các gói liên quan
$ cd classification
$ conda create -n classification python=3.6
$ pip install -r requirements.txt

Hướng dẫn sử dụng

Trước khi chạy các thử nghiệm, hãy chắc chắn bạn đã activate môi trường classification, mọi câu lệnh đều được chạy trong thư mục gốc của dự án.

$ cd classification
$ source activate classification

Sử dụng mô hình có sẵn

Dự đoán nhãn của một câu:

$ python classification.py "Trong phần lớn thời gian sáng nay, thầy trò HLV Park Hang Seo có cuộc họp nội bộ tại khách sạn. Tại cuộc họp này, nội dung quan trọng nhất chính là xem băng ghi hình một số trận đấu gần nhất của đội chủ nhà, giúp đội tuyển Việt Nam đưa ra những phương án đối phó trong trận ra quân tại AFF Cup 2018 sắp tới."
The thao

Dự đoán nhãn từ nội dung trong file, sử dụng tùy chọn --fin

$ python classification.py \
    --fin tmp/input.txt
Kinh doanh

Huấn luyện mô hình

Tiền xử lý dữ liệu

Lấy về bộ dữ liệu VNTC

$ sh util/get_vntc.sh

Tập dữ liệu được quy chuẩn từng nhãn theo từng danh mục chứa các file văn bản như tập dữ liệu trong thư mục data/raw

Chuyển đổi tập dữ liệu thành file excel

$ python util/preprocess_vntc.py

So sánh các thử nghiệm

Các thử nghiệm kết hợp LinearSVC và CountVectorizer

$  python optimize_hyperparameters.py --mode optimize 
            --train data/corpus/train.xlsx 
            --test data/corpus/test.xlsx 
            --trans tfidf 
$ python optimize_hyperparameters.py --mode optimize 
            --train data/corpus/train.xlsx
            --test data/corpus/test.xlsx 
            --trans count 

Huấn luyện và lưu mô hình

$ python train.py --mode train-test 
            --train data/corpus/train.xlsx 
            --test data/corpus/test.xlsx 
            --s models

Sử dụng mô hình đã huấn luyện

Dự đoán nhãn của một câu:

$ python classification.py "Trong suốt kỳ chuyển nhượng mùa hè qua, tiền vệ Eden Hazard của Chelsea đã luôn được Real Madrid nhắm đến để thay thế Cristiano Ronaldo nhưng bất thành. Mới đây, Hazard đã cho biết anh đang chờ đợi thêm những tín hiệu chiêu mộ từ Real Madrid trước khi đưa ra quyết định về tương lai của mình ở Chelsea."
Bong da

Dự đoán nhãn từ nội dung trong file, sử dụng tùy chọn --fin

$ python classification.py \
    --fin tmp/input.txt
Giao duc

Trích dẫn

Nếu bạn sử dụng mã nguồn này, xin hãy trích dẫn thông tin sau

@online{undertheseanlp/classification,
author ={Vu Anh, Pham Hong Quang},
year = {2019},
title ={Phân loại văn bản tiếng Việt},
url ={https://github.com/undertheseanlp/classification}
}

Lời cảm ơn

Xin chân thành cảm ơn các nhóm phát triển sklearn, fasttext đã tạo ra những công cụ hữu ích để nhóm sử dụng trong các thử nghiệm của mình.

Bản quyền

Mã nguồn của dự án được phân phối theo giấy phép GPL-3.0.

Dự án sử dụng tập dữ liệu VNTC trong các thử nghiệm. Xin vui lòng kiểm tra lại thông tin trên website hoặc báo cáo khoa học tương ứng để biết thông tin về bản quyền và trích dẫn khi sử dụng tập dữ liệu này.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].