资源简介
LSTM+CRF模型项包含完整代码LSTM+CRF模型项包含完整代码
![](http://www.nz998.com/pic/62567.jpg)
代码片段和文件信息
from model.config import Config
from model.data_utils import CoNLLDataset get_vocabs UNK NUM \
get_glove_vocab write_vocab load_vocab get_char_vocab \
export_trimmed_glove_vectors get_processing_word
def main():
“““Procedure to build data
You MUST RUN this procedure. It iterates over the whole dataset (train
dev and test) and extract the vocabularies in terms of words tags and
characters. Having built the vocabularies it writes them in a file. The
writing of vocabulary in a file assigns an id (the line #) to each word.
It then extract the relevant GloVe vectors and stores them in a np array
such that the i-th entry corresponds to the i-th word in the vocabulary.
Args:
config: (instance of Config) has attributes like hyper-params...
“““
# get config and processing of words
config = Config(load=False)
processing_word = get_processing_word(lowercase=True)
# Generators
dev = CoNLLDataset(config.filename_dev processing_word)
test = CoNLLDataset(config.filename_test processing_word)
train = CoNLLDataset(config.filename_train processing_word)
# Build Word and Tag vocab
vocab_words vocab_tags = get_vocabs([train dev test])
vocab_glove = get_glove_vocab(config.filename_glove)
vocab = vocab_words & vocab_glove
vocab.add(UNK)
vocab.add(NUM)
# Save vocab
write_vocab(vocab config.filename_words)
write_vocab(vocab_tags config.filename_tags)
# Trim GloVe Vectors
vocab = load_vocab(config.filename_words)
export_trimmed_glove_vectors(vocab config.filename_glove
config.filename_trimmed config.dim_word)
# Build and save char vocab
train = CoNLLDataset(config.filename_train)
vocab_chars = get_char_vocab(train)
write_vocab(vocab_chars config.filename_chars)
if __name__ == “__main__“:
main()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-12-20 03:16 LSTM+CRF_seq_tagging-master\
文件 51 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\.gitignore
文件 10762 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\LICENSE.txt
文件 2654 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\README.md
文件 1920 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\build_data.py
目录 0 2018-12-20 03:16 LSTM+CRF_seq_tagging-master\data\
文件 819 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\data\test.txt
文件 2141 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\evaluate.py
文件 202 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\makefile
目录 0 2018-12-20 03:16 LSTM+CRF_seq_tagging-master\model\
文件 0 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\model\__init__.py
文件 4828 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\model\ba
文件 3321 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\model\config.py
文件 11676 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\model\data_utils.py
文件 4682 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\model\general_utils.py
文件 13429 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\model\ner_model.py
文件 30 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\requirements.txt
文件 753 2017-11-09 03:14 LSTM+CRF_seq_tagging-master\train.py
- 上一篇:designv2.circ
- 下一篇:用于通信的4PPM编码verilog代码
相关资源
- 基于双向LSTM+tensorflow中文分词
- 处理好的人民日报语料,可以直接用
- 深度学习框架下LSTM网络在短期电力负
- 用RNN与LSTM网络原理进行唐诗生成.ta
- Dence CRF 条件随机场图像分割
- CC2530 BasicRFTI源文件
- LSTMandRNN.zip
- 天池大数据竞赛LSTM预测算法分享
- RNN与LSTM详解ppt
- 基于BLSTM-Attention-CRF模型的新能源汽车
- Understanding LSTM Networks
- IMS PCRF开源代码
- 条件随机场,一个比较详细的ppt
- 递归神经网络RNN与LSTM
- 中文NLP命名实体识别序列标注工具Y
- LSTM多变量预测
- crf分词标注训练语料
- 循环神经网络和LSTM课件
- 条件随机场CRF命名实体识别实验
- 基于深度学习LSTM网络的短期电力负荷
- LSTM神经网络训练的PTB语料
- CRF_maxent.rar
- 基于Keras的LSTM股价预测代码
- lstm长短时记忆神经网络PPT
- CRF++-0.58 Linux版本,CRF++安装包
- crf++0.58.tar.gz
- CRF++ toolkit 0.58
- 深入理解LSTM
- Bi-LSTM_CRF_NER.rar
- CRF,LSTM,最大后向匹配法实现中文分
评论
共有 条评论