随笔分类 - NLP代码记录
摘要:返回x,y的列表集合 正则 只保留汉字 获取句子的最大长度 句子转数字 ,输入是句子的列表 数字转句子 python def loadEmbeddingsFile(embedding_file_path): embeddings_dict = {} with open(embedding_file_
阅读全文
摘要:```python from gensim.models.keyedvectors import KeyedVectors model2 = KeyedVectors.load_word2vec_format('embedding1.txt', binary=False) ```
阅读全文
摘要:```python import pandas as pd stop_words = [] with open('data/stop_words.txt','r',encoding='utf-8') as f: lines = f.readlines() for i in lines: word = i.strip() stop_words.append(word) print(stop_word
阅读全文