• Stars
    star
    142
  • Rank 257,024 (Top 6 %)
  • Language
    Python
  • Created over 6 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

本项目主要为针对DPCNN(Deep Pyramid Convolutional Neural Networks for Text Categorization )文本分类(Text Classification)的论文复现以及基于知乎看山杯Inception的修改和复现,后者效果略优。

声明

  • 由于本项目源于合作项目,故无法提供LoadData.py部分,敬请谅解。
  • 本项目主要为针对DPCNN(Deep Pyramid Convolutional Neural Networks for Text Categorization )的论文复现以及基于知乎看山杯Inception的修改和复现,后者效果略优。
  • 本项目基于Pytorch框架实现,但内部使用 tensorboardX 进行tensorboard支持。
  • 项目所需非基础requirement列于requirements.txt中,可使用pip install -r requirements.txt命令一键安装。
  • 模型置于models文件夹下。
  • 感谢Zekang Li的部分代码合作。

模型简介

  • BasicModule:基类模型,提供基础的保存读取功能
  • TextCNNDeep:基于原始论文的dpcnn模型,前置特征提取为标准TextCNN
  • TextCNNInc:基于知乎看山杯的TextCNN模型
  • TextCNNIncDeep:改进后的dpcnn模型,基于知乎看山杯的TextCNN模型

参数部分

公共参数设置

  • self.USE_CUDA = torch.cuda.is_available() # GPU是否可用
  • self.RUNNING_ON_SERVER = False # 代码运行在本地还是服务器
  • self.SUMMARY_PATH = "summary/TextCNN_char" # 设定tensorboard保存路径
  • self.NET_SAVE_PATH = "./source/trained_net/" # 训练好的网络的储存位置
  • self.TRAIN_DATASET_PATH = "../test_train/xx.txt" # 训练集位置
  • self.TEST_DATASET_PATH = "../test_train/xx.txt" # 测试集位置
  • self.NUM_EPOCHS = 1000 # 本次BATCH数目
  • self.BATCH_SIZE = 32 # 每个BATCH数据大小
  • self.TOP_NUM = 4 # 测试时需求前几的Acc
  • self.NUM_WORKERS = 4 # pytorch用几个线程工作读数据
  • self.IS_TRAINING = True # 选择模式“训练”或“测试”
  • self.ENSEMBLE_TEST = False # 测试模式下是否需要模型融合测试
  • self.LEARNING_RATE = 0.001 # 学习率
  • self.RE_TRAIN = False # 本次训练是否要加载之前训练好的模型
  • self.TEST_POSITION = 'xxx Server' # 本次训练运行在哪里

模型共享参数设置

  • self.OPTIMIZER = 'Adam' # 优化器选择
  • self.USE_CHAR = True # 使用char还是词
  • self.USE_WORD2VEC = True # 使用词语时是否使用词向量
  • self.NUM_CLASSES = 1890 # 本次训练的分类数
  • self.EMBEDDING_DIM = 512 # 词嵌入的维度
  • self.VOCAB_SIZE = 20029 # 生成的词库大小
  • self.CHAR_SIZE = 3403 # 生成的字库大小

TextCNN模型设置

  • self.TITLE_DIM = 200 # 中间层维度
  • self.SENT_LEN = 20 # 句子截断长度
  • self.LINER_HID_SIZE = 2000 # fc中间层维度
  • self.KERNEL_SIZE = [1,2,3,4,5] # 卷积核大小

TextCNNInc模型设置

self.SIN_KER_SIZE = [1, 3] # 单层卷积卷积核大小 self.DOU_KER_SIZE = [(1, 3), (3, 5)] # 双层卷积卷积核大小。元组内第一项为第一层 # conv的核尺寸,第二项为第二层conv的核尺寸,

More Repositories

1

pytorch-lightning-template

An easy/swift-to-adapt PyTorch-Lighting template. 套壳模板,简单易用,稍改原来Pytorch代码,即可适配Lightning。You can translate your previous Pytorch code much easier using this template, and keep your freedom to edit all the functions as well. Big-project-friendly as well. No need to rewrite your config in hydra.
Jupyter Notebook
1,294
star
2

Markdown4Zhihu

一键解决知乎导入Markdown文件时图片和公式等问题。
Python
85
star
3

HUST-Grad-Paper-Word-Template

本项目为华科(华中科技大学)本科生毕业论文的进阶优化版Word模板。它源于官方但高于官方,由于官方的Word模板难以使用且问题多多,自动化程度低,故有本项目。本项目为在页码、封面、分级标题、数学公式、图表题注、交叉引用、参考文献引用等方面做出了优化后的Word模板。
77
star
4

HCRS-Online

华彩人生 -- 一款为华科(华中科技大学,HUST)量身打造的游戏;一款在华科这片神奇土地上展开的奇幻RPG游戏;一款高仿真的华科模拟器,获“讲好华中大故事”一等奖。想要了解华科的同学请来康一康! 本Repo为游戏华彩人生的在线版本。你可以直接进入游戏而无需下载。
JavaScript
64
star
5

anime_renamer

Python
44
star
6

one-key-linux-setup

Scripts which aims to initialize and configure a linux system quickly. Mainly include update, zsh, oh-my-zsh, zsh plugins, python, and so on. Continue to update and welcome issues.
Shell
18
star
7

anime-2-cosplay

Turn your 2-D wife(anime image) to 3-D wife(cosplay image) or opposite using DCGAN!
Python
14
star
8

Hua-Cai-Ren-Sheng

华彩人生 -- 一款为华科(华中科技大学)量身打造的游戏;一款在华科这片神奇土地上展开的奇幻RPG游戏;一款高仿真的华科模拟器。想要了解华科的同学请务必来玩哦~相信不会让你失望! 引擎:RPGMaker MV
JavaScript
14
star
9

Trainable-i3d-pytorch

A re-trainable version version of i3d. It is a superset of kinetics_i3d_pytorch repo from hassony2. You can train on your own dataset, and this repo also provide a complete tool which can generate RGB and Flow npy file from your video or a sets of images.
Python
7
star
10

pytorch-basic-module

A wrapped basic model class for pytorch models. You can Inherit it to make your model easier to use. It contains methods such as load, save, multi-thread save, parallel distribution, train, validate, predict and so on.
Python
7
star
11

Tomasulo-Visual

A visualization project of Tomasulo algorithm which make it easier to understand. Java-based project with very nice GUI support.
HTML
5
star
12

6-pic-vote-mobilenet

A directory which aims to do card classification based on 6 base pictures generated from the original image.
Jupyter Notebook
5
star
13

Edge-Detection-OpenCV

An edge detection program using OpenCV. It allows batch processing. You can choose whether the output is a white or black background. I mainly used it to get the sketch of anime images. 一个用OpenCV实现的边缘提取便利小程序。它支持批处理,并可以通过Arg指定白底黑线或相反。我用它来提取动漫图片线稿~
Python
5
star
14

Meta-SSSR-Pytorch-Publish

Jupyter Notebook
4
star
15

TextCNN-LSTM-AI-Bot

A Project which utilize TextCNN and LSTM and their variant to build a Chinese AI customer service bot mainly using text Classification.
Python
4
star
16

hexo-migrator

Migrate all of your image links inside your personal blog from third-party image bed to local folder which can make the lost image link re-show images. It works for hexo. 适用于将hexo个人博客中微博等图床图片下载迁移到本地部署。
Python
4
star
17

Face-Recognition-Using-Baidu-API

This is a face recognition program using python and baidu's API. You can use it to do face recognition, upload faces library, take photo and almost all it can do. It provide you with a complete process.
Python
4
star
18

mlib

Personal library for python.
Python
3
star
19

RL-PCB-Optimization

A project aimes to use RL to optimize PCB structure.
Python
3
star
20

pixiv-50-crawler

批量爬取经过人工筛选和去重的Pixiv每日最佳图片(不含漫画)。可指定整日/月/年的爬取。
Python
3
star
21

Diode-Electron-Hole-Particles-Simulation

This repository is a python version of a Matlab simulation program of diode electron and hole particles. It is based on an initial code which is automatically translated from Matlab code so it is in a messy to some extent.
Python
2
star
22

cs231n_assignment_HUST

Digital Image Processing Design in Seedclass2015, using cs231n slides as teaching material.
Jupyter Notebook
2
star
23

opencv-object-detector

An object detector using OpenCV, writing in Jupyter Notebook.
Jupyter Notebook
2
star
24

linux-noise-detect-with-DL

A project that aims to use DL to detect whether a linux system is interfered by USB/Wi-Fi/WAN/LAN or other ports.
Jupyter Notebook
2
star
25

HUST-GPA-Calculator

华科(华中科技大学,HUST)GPA计算器。依次输入你的各项成绩和学分,该计算器可以按照华科的算法算出你的GPA。结果将被保存在相同文件夹下的txt文件中并且会被打印到屏幕。支持计算总平均绩点与最后两年平均绩点,以及各种时段的GPA计算。
Python
2
star
26

guiparse

给我一个使用了argparse的python脚本,丢给你一个不错的GUI!只需改很少几行贴示例代码段就好!Give me a python script with argparse, give you back a nice GUI with original function running properly!
Python
2
star
27

Poisson-Equation-Solving-with-DL

Poisson Equation Solver with Deep Learning
HTML
1
star
28

darknet-mini-pred-2-xml

Using YOLO VOC to detect objects and output the result to xml files which share the same data structure with original VOC dataset in batch.
Python
1
star
29

OpenCV-Crop-Video-Area-Batch

Crop a certain area from the input video using OpenCV. You only need to click two diagonal points of the rectangle area. It acts in batch and works fast.
Python
1
star
30

yelan-dynamic-dvs-hpe

The official implementation of paper Neuromorphic high-frequency 3D dancing pose estimation in dynamic environment in Neurocomputing, 547, 2023.
Jupyter Notebook
1
star
31

logging-BestPractice-DeepLearning

logging Module's Best Practices in Deep Learning Projects
Python
1
star
32

Mixer-Live-Stream-Batch-Download

A python script to download the first N(customizable) live streams in batch and at the same time from site Mixer.com . Also, auto correction will be applied after the download finished.
Python
1
star
33

voronoi-hsi-generation

Jupyter Notebook
1
star
34

Android-Start-Dash

An easy and clean android program. It contains a name shower and adder. You can learn how to build the most basic android application here.
Java
1
star
35

DDR5-crosstalk-optimization-using-DRL-et-GAN

Python
1
star
36

auto-wash-images

This repo aims to filter bad images(for example: badly hand drawing ones, Q-version ones, multi character ones ), which you need to do is just put some sample images in different genre in the Datasets folders and train it! It is based on pytorch while it supports tensorboard.
Python
1
star
37

cosplay-anime-cotrain

This repo contains a deep learning network which aims to give a score to evaluate how well a coser performs by training cosplay images and anime images by different net and then coalesce.
Python
1
star
38

konachan-multi-thread-crawler

A crawler which use beautifulsoup4 to crawl images under a certain tag. It uses multi-thread and thus it's fast enough. The name is very neat and beautiful.
Python
1
star
39

NaiveBayes_Email_Discrimination

A project whose target is to discriminate whether a email is a spam or a ham.It utilized two method to do this work, one is using the naive Bayes method while another is to do it with the help of fisherman's way. And as for the result, the recent result is that it can discriminate ham from spam with a rate of 99.5% and it can also tell spam from ham with a rate of almost 95%. As a whole, its accurate rate is 98.55%(tested under fisherman's way). What's more, the train data together with the test data is inside, therefore, you can also try it yourself!
Python
1
star