
nlp
Forever_Young_L
这个作者很懒,什么都没留下…
展开
-
哈工大LTP使用
# coding=utf-8from pyltp import SentenceSplitterfrom pyltp import Segmentorfrom pyltp import Postaggerfrom pyltp import NamedEntityRecognizerfrom pyltp import Parserfrom nltk import DependencyGr...原创 2020-05-06 20:22:13 · 600 阅读 · 0 评论 -
维基百科简体中文语料训练word2vec词向量
维基百科简体中文语料训练word2vec词向量步骤:1.下载维基百科中文语料2.使用工具从压缩包中抽取正文文本3.将繁体字转简体字4.分词5.训练模型6.测试模型1.下载维基百科中文语料语料下载地址:https://dumps.wikimedia.org/zhwiki/有不同时间段的下载地址,我们需要训练词向量,请选择包含articles.xml.bz2字段的链接(包含词...原创 2020-04-01 11:54:00 · 1945 阅读 · 1 评论 -
WikiExtractor.py(维基百科抽取器)
#!/usr/bin/env python# -*- coding: utf-8 -*-# =============================================================================# Version: 2.75 (March 4, 2017)# Author: Giuseppe Attardi (attardi@di....原创 2020-03-31 11:02:49 · 3831 阅读 · 2 评论 -
lda c++代码
#include<bits/stdc++.h>using namespace std;typedef long long ll;const int INF=0x3f3f3f3f;const int MAX_M=1e4+5;const int MAX_K=30+5;const int MAX_N=1e6+5;struct node{ int id,k;//词...原创 2020-02-10 20:26:29 · 952 阅读 · 5 评论 -
plsa c++代码
#include<bits/stdc++.h>using namespace std;typedef long long ll;const int INF=0x3f3f3f3f;const int MAX_M=1e3+5;const int MAX_K=30+5;const int MAX_N=1e6+5;struct node{ int num; ...原创 2020-01-30 15:24:28 · 199 阅读 · 0 评论 -
lda Python代码
import chardetimport jiebaimport gensimS1 = []S2 = []with open('C:\\Users\\28612\\Desktop\\news_sohusite_xml.dat', 'rb') as f: lines = f.readlines() ans = 0 for line in lines: ...原创 2020-01-21 21:05:51 · 600 阅读 · 2 评论