Skip to content
프로젝트

jiegzhan/multi-class-text-classification-cnn-rnn

GitHub에서 보기

소개

Kaggle San Francisco Crime Description 데이터셋을 39개 클래스로 분류합니다. TensorFlow에서 CNN, RNN(GRU 및 LSTM), 단어 임베딩을 사용해 모델을 구축합니다.

AI 및 머신러닝

이 수치를 측정하는 방법

What you can do

  • Multi-class text classification (sentence classification) problem.
  • Classify Kaggle San Francisco Crime Descript into 39 Category labels.
  • Hybrid TextCNN + GRU model implemented with TensorFlow 2.x Keras.

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Project: Classify Kaggle San Francisco Crime Description

Highlights

  • Multi-class text classification (sentence classification) problem.
  • Classify Kaggle San Francisco Crime Descript into 39 Category labels.
  • Hybrid TextCNN + GRU model implemented with TensorFlow 2.x Keras.

Data: Kaggle San Francisco Crime

  • Input: Descript
  • Output: Category

Examples:

Descript Category
GRAND THEFT FROM LOCKED AUTO LARCENY/THEFT
POSSESSION OF NARCOTICS PARAPHERNALIA DRUG/NARCOTIC

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Training data is included at ./data/train.csv.zip. Prediction sample data is at ./data/small_samples.csv.

Train

python3 train.py ./data/train.csv.zip ./training_config.json

Artifacts are written to ./trained_results_<timestamp>/:

  • saved_model/ — exported SavedModel for inference
  • best_model.keras — best validation checkpoint (primary load path for predict)
  • words_index.json — vocabulary mapping
  • labels.json — class labels
  • trained_parameters.json — hyperparameters and sequence length

Predict

python3 predict.py ./trained_results_<timestamp>/ ./data/small_samples.csv

Predictions are saved to ./predicted_results_<timestamp>/predictions_all.csv.

Reference

관련 프로젝트 살펴보기

불러오는 중…