• Stars
    star
    290
  • Rank 142,102 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Chinese-Text-Classification,Tensorflow CNN(卷积神经网络)实现的中文文本分类。QQ群:522785813,微信群二维码:http://www.tensorflownews.com/

用卷积神经网络基于 Tensorflow 实现的中文文本分类

这个项目是基于以下项目改写: cnn-text-classification-tf

关于 Chinese-Text-Classification 的问题欢迎来这里提问

主要的改动:

  • 兼容 tensorflow 1.2 以上
  • 增加了中文数据集
  • 增加了中文处理流程

特性:

  • 兼容最新 TensorFlow
  • 中文数据集
  • 基于 jieba 的中文处理工具
  • 模型训练,模型保存,模型评估的完整实现

训练结果

模型评估

以下为原项目的 README

This code belongs to the "Implementing a CNN for Text Classification in Tensorflow" blog post.

It is slightly simplified implementation of Kim's Convolutional Neural Networks for Sentence Classification paper in Tensorflow.

Requirements

  • Python 3
  • Tensorflow > 1.2
  • Numpy

Training

Print parameters:

./train.py --help
optional arguments:
  -h, --help            show this help message and exit
  --embedding_dim EMBEDDING_DIM
                        Dimensionality of character embedding (default: 128)
  --filter_sizes FILTER_SIZES
                        Comma-separated filter sizes (default: '3,4,5')
  --num_filters NUM_FILTERS
                        Number of filters per filter size (default: 128)
  --l2_reg_lambda L2_REG_LAMBDA
                        L2 regularizaion lambda (default: 0.0)
  --dropout_keep_prob DROPOUT_KEEP_PROB
                        Dropout keep probability (default: 0.5)
  --batch_size BATCH_SIZE
                        Batch Size (default: 64)
  --num_epochs NUM_EPOCHS
                        Number of training epochs (default: 100)
  --evaluate_every EVALUATE_EVERY
                        Evaluate model on dev set after this many steps
                        (default: 100)
  --checkpoint_every CHECKPOINT_EVERY
                        Save model after this many steps (default: 100)
  --allow_soft_placement ALLOW_SOFT_PLACEMENT
                        Allow device soft device placement
  --noallow_soft_placement
  --log_device_placement LOG_DEVICE_PLACEMENT
                        Log placement of ops on devices
  --nolog_device_placement

Train:

./train.py

Evaluating

./eval.py --eval_train --checkpoint_dir="./runs/1459637919/checkpoints/"

Replace the checkpoint dir with the output from the training. To use your own data, change the eval.py script to load your data.

References

More Repositories

1

PyTorchDocs

PyTorch 官方中文教程包含 60 分钟快速入门教程,强化教程,计算机视觉,自然语言处理,生成对抗网络,强化学习。欢迎 Star,Fork!
Python
2,405
star
2

Awesome-Chatbot

Awesome Chatbot Projects,Corpus,Papers,Tutorials.Chinese Chatbot =>:
Python
1,934
star
3

Awesome-TensorFlow-Chinese

Awesome-TensorFlow-Chinese,TensorFlow 中文资源精选,官方网站,安装教程,入门教程,视频教程,实战项目,学习路径。QQ群:167122861,公众号:磐创AI,微信群二维码:http://www.tensorflownews.com/
Python
1,321
star
4

OpenCVTutorials

OpenCV-Python4.1 中文文档
Python
1,216
star
5

FaceRank

FaceRank - Rank Face by CNN Model based on TensorFlow (add keras version). FaceRank-人脸打分基于 TensorFlow (新增 Keras 版本) 的 CNN 模型(QQ群:167122861)。技术支持:http://tensorflow123.com
Python
859
star
6

pytorch1.0-cn

PyTorch 1.0 官方文档 中文版,欢迎关注微信公众号:磐创AI
314
star
7

Awesome-Text-Classification

Awesome-Text-Classification Projects,Papers,Tutorial .
167
star
8

ArbitrageBot

ArbitrageBot, Detect Arbitrage Opportunities, Trading Clients, etc.
130
star
9

ChatGirl

ChatGirl is an AI ChatBot based on TensorFlow Seq2Seq Model. ChatGirl 一个基于 TensorFlow Seq2Seq 模型的聊天机器人。(包含预处理过的 twitter 英文数据集,训练,运行,工具代码,来波 Star 。)QQ群:167122861
Python
108
star
10

Free-Tensorflow

Tensorflow 免费中文视频教程,开源代码,免费书籍.
84
star
11

BossComing

If your boss is coming ,send your phone a notification, based on face_recognition for face recognition and JPush to send notification.Just for fun!(the code is under dev branch)老板来了:人脸识别+手机推送,老板来了发送手机通知,你立刻知道。(代码在 dev 分支)
81
star
12

chat_wordpress

基于 ChatGPT 一个关键词批量生成内容,批量发布到 WordPress
Python
21
star
13

ChatClipboard

Boost Your ChatGPT Productivity with ChatClipboard - The Ultimate Desktop App for Effortless Text Response!
Python
11
star
14

CampusRecruitmentBus

欢迎关注微信公众号:校招巴士
8
star
15

babyagi_zh

babyagi_zh(通用人工智能婴儿版支持中文任务)
Python
7
star
16

AIGCOK

Awesome AIGC Applications.很棒的一些 AIGC(人工智能生成内容应用)
5
star
17

PyTorchVideo

PyTorch 官方文档视频版上线B站
5
star
18

OfferBus

21届&22届春招内推重磅来袭!(含腾讯、阿里、字节、京东、顺丰科技等50+大厂内推方式,不断更新中)
4
star
19

Word2Id_Chinese

Word2Id_Chinese:Chinese Sentences to ids,ids to Chinese Sentences.中文句子转索引,索引转中文,创建词典。
Python
4
star
20

DeepQA-Tutorial

5 步做一个 TensorFlow 聊天机器人: DeepQA 教程
4
star
21

PyTorchHub

HTML
3
star
22

ChatBotHub

ChatBotHub get response from multi chatgpt website. ChatBotHub 一键同时从多个 chatgpt 网页获得回复。
Python
3
star
23

TensorFlow-Examples-Guide

TensorFlow 实战,代码基于 TensorFlow-Examples。TensorFlow-Examples-Guide is based on TensorFlow-Examples :https://github.com/aymericdamien/TensorFlow-Examples
Python
2
star
24

PyTorchTutorial

PyTorchTutorial
2
star
25

fendouai.github.io

blog
1
star
26

TensorFlow-Examples-Chinese

TensorFlow Tutorial and Examples for Beginners (TensorFlow v2)
1
star