当前位置:网站首页>阿里天池学习赛 新闻文本分类
阿里天池学习赛 新闻文本分类
2022-08-11 05:13:00 【甜辣uu】
当时我的成绩 阿里天池
原始数据 训练的词向量 模型 代码都在下面这两个链接里 一个完整版 一个不完整版
链接:https://pan.baidu.com/s/1I8l-5f0-IlrSPa3aP6nY2A
提取码:1111
复制这段内容后打开百度网盘手机App,操作更方便哦
链接:https://pan.baidu.com/s/1XNaM7fc96aSBi-sML-_vEw
提取码:1111
复制这段内容后打开百度网盘手机App,操作更方便哦
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
#csv数据量的数目测试 一共有20000条
with open("train_set839.csv", 'r') as f: #计算长度
hang_count=len(f.readlines())
# print(hang_count)
#先把csv中一个句子拿出来 然后把每个单词去词训练库里面找对应的向量规定对于每个句子矩阵都构建一个2000,300的矩阵。
def hang_vectoes_label(index): # 要读取csv文本第几行的文章数据 会返回一个 列表里面是文章的词向量矩阵和标签值
row=df.va
边栏推荐
- 将double类型的数据转为字符串
- [Embedded open source library] The use of cJSON, an efficient and streamlined json parsing library
- 2022 building welder (building a special type of work) examination questions and simulation test
- Delphi7学习记录-demo实例
- Idea essential skills to improve work efficiency
- In the closing pages/uninstall (unload) sends a request to the server before the document
- LeetCode刷题Top100之两数之和
- Redis详解
- About CC Attacks
- C语句:数据存储
猜你喜欢
随机推荐
【无标题】2022年胺基化工艺考试题模拟考试题库及在线模拟考试
oracle表空间与用户的创建
课堂练习--0708
并发编程之线程基础
Paper Notes: BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
shell 脚本编程---入门
[Embedded open source library] The use of cJSON, an efficient and streamlined json parsing library
Switches and routers technologies - 30 - standard acls
代理模式(简要介绍)
Thymeleaf
Day38 LeetCode
IDEA使用记录
金仓数据库 KingbaseGIS 使用手册(6.10. 几何对象操作运算符)
Mysql introductory exercise
C语言题解:谁是凶手!
for循环使用多线程优化
leetcode 9. Palindromic Numbers
MySQL数据库管理
什么是三次握手和四次挥手(清晰易懂)
输入字符串,替换其中敏感词进行输出