基于深度神经网路的文本分类 基于主流的lstm模型
原始的数据和中间的训练 模型 链接:https://pan.baidu.com/s/1jge-RGWc_YXvnOKxEr0pkg
提取码:u5iq
复制这段内容后打开百度网盘手机App,操作更方便哦
# -*- coding: utf-8 -*-
import pandas as pd
import gensim
import jieba
import re
import numpy as np
from sklearn.model_selection import train_test_split
from gensim.models import KeyedVectors
from gensim.scripts.glove2word2vec import glove2word2vec
import pandas as pd
import numpy as np
import torch
from torch import nn
import torch.utils.data as data
import torch.nn.functional as F
from torch import tensor
from sklearn.metrics import f1_score
from datetime import datetime
import time
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM,GRU
from keras import optimizers
import keras
# 读取数据
data=pd.read_csv('comments.txt',encoding='utf-8',sep=' ',delimiter="\t")
data.values
print(len(data.values