-
大小: 123KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-06-15
- 语言: 其他
- 标签: BiLSTM-CRF Deep Learnin
资源简介
使用深度学习方法BiLSTM,并结合CRF模型的标签依赖性特点,解决命名实体识别的序列标注问题
代码片段和文件信息
“““Build an np.array from some glove file and some vocab file
You need to download ‘glove.840B.300d.txt‘ from
https://nlp.stanford.edu/projects/glove/ and you need to have built
your vocabulary first (Maybe using ‘build_vocab.py‘)
“““
__author__ = “Guillaume Genthial“
from pathlib import Path
import numpy as np
if __name__ == ‘__main__‘:
# Load vocab
with Path(‘vocab.words.txt‘).open() as f:
word_to_idx = {line.strip(): idx for idx line in enumerate(f)}
size_vocab = len(word_to_idx)
# Array of zeros
embeddings = np.zeros((size_vocab 300))
# Get relevant glove vectors
found = 0
print(‘Reading GloVe file (may take a while)‘)
with Path(‘glove.840B.300d.txt‘).open() as f:
for line_idx line in enumerate(f):
if line_idx % 100000 == 0:
print(‘- At line {}‘.format(line_idx))
line = line.strip().split()
if len(line) != 300 + 1:
continue
word = line[0]
embedding = line[1:]
if word in word_to_idx:
found += 1
word_idx = word_to_idx[word]
embeddings[word_idx] = embedding
print(‘- done. Found {} vectors for {} words‘.format(found size_vocab))
# Save np.array to file
np.savez_compressed(‘glove.npz‘ embeddings=embeddings)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-10 03:03 tf_ner-master\
文件 10763 2018-10-10 03:03 tf_ner-master\LICENSE
文件 7383 2018-10-10 03:03 tf_ner-master\README.md
目录 0 2018-10-10 03:03 tf_ner-master\data\
目录 0 2018-10-10 03:03 tf_ner-master\data\example\
文件 206 2018-10-10 03:03 tf_ner-master\data\example\Makefile
文件 1354 2018-10-10 03:03 tf_ner-master\data\example\build_glove.py
文件 1960 2018-10-10 03:03 tf_ner-master\data\example\build_vocab.py
文件 35951 2018-10-10 03:03 tf_ner-master\data\example\glove.npz
文件 156 2018-10-10 03:03 tf_ner-master\data\example\testa.tags.txt
文件 212 2018-10-10 03:03 tf_ner-master\data\example\testa.words.txt
文件 156 2018-10-10 03:03 tf_ner-master\data\example\testb.tags.txt
文件 212 2018-10-10 03:03 tf_ner-master\data\example\testb.words.txt
文件 156 2018-10-10 03:03 tf_ner-master\data\example\train.tags.txt
文件 212 2018-10-10 03:03 tf_ner-master\data\example\train.words.txt
文件 64 2018-10-10 03:03 tf_ner-master\data\example\vocab.chars.txt
文件 20 2018-10-10 03:03 tf_ner-master\data\example\vocab.tags.txt
文件 140 2018-10-10 03:03 tf_ner-master\data\example\vocab.words.txt
目录 0 2018-10-10 03:03 tf_ner-master\images\
文件 39578 2018-10-10 03:03 tf_ner-master\images\data.png
文件 19599 2018-10-10 03:03 tf_ner-master\images\ner.png
目录 0 2018-10-10 03:03 tf_ner-master\models\
目录 0 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf\
文件 8866 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf\main.py
文件 1557 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf\masked_conv.py
文件 315 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf\metrics.py
目录 0 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf_ema\
文件 10997 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf_ema\main.py
文件 1557 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf_ema\masked_conv.py
文件 577 2018-10-10 03:03 tf_ner-master\models\chars_conv_lstm_crf_ema\metrics.py
目录 0 2018-10-10 03:03 tf_ner-master\models\chars_lstm_lstm_crf\
............此处省略13个文件信息
- 上一篇:PSNR源代码
- 下一篇:flotr2.min.js 包 及简单
相关资源
- Deep Exploration 6.5 注册机
- 20万张车牌数据集
-
论文笔记—Gradient-ba
sed me ta-Learn - SLEP(Sparse Learning with Efficient Projecti
- Code for a painless q-learning tutorial
- understand machine learning theory to algorith
- tensorflow识别花朵
- 机器学习与R语言machine_learning
- A Tutorial on Computational Learning Theory
- 最近翻译了一篇2018年人脸识别综述
- 基于深度学习网络模型的鱼群异常行
- 一种识别交通标志的多层次化神经网
- DeepLearnToolbox-regression.zip
- DBN代码注释
- Faster RCNN pytroch代码
- Deep Reinforcement Learning for List-wise Reco
- Tieyan_Liu Learning to Rank for Information Re
- machine learning SVM classify algorithm
- Learning.Node-Node学习指南.txt
- Coursera Machine Learning 第二周编程全套满
- Learning with kernel
- Relation Classification via Convolutional Deep
- wide&deep;.zip
- 多种方法实现通信信号分类.tar.gz
- deepstream_sdk_v5.0.0_jetson.tbz2
- 吴恩达老师深度学习第二课第二周2
- Deepnude.txt134103
- 基于Deep Belief Nets 的中文名实体关系抽
- AlphaGo源码
- Machine learning DecisionTree
评论
共有 条评论