Understanding LSTM model using tensorflow for sentiment analysis
问题 I am trying to learn LSTM model for sentiment analysis using Tensorflow, I have gone through the LSTM model. Following code (create_sentiment_featuresets.py) generates the lexicon from 5000 positive sentences and 5000 negative sentences . import nltk from nltk.tokenize import word_tokenize import numpy as np import random from collections import Counter from nltk.stem import WordNetLemmatizer lemmatizer = WordNetLemmatizer() def create_lexicon(pos, neg): lexicon = [] with open(pos, 'r') as f: