Teams and Organizations Toggle sub-navigation.Plans and Pricing Toggle sub-navigation.This movie was Saving Private Ryan, but boring and predictable.") I highly doubt he met a strange woman with an abandoned child and I highly doubt any of this even happened. The only exciting part about the movie was the very end when finally people were dying and it represented WW1. The acting was terrible and the story was common and nonsense. War scenes with gratuitous up close views of corpses and body parts that don't add anything to the story got old quick.")ĭata_string = Preparing_string("Predictable and horrendous. The cinematography tried so hard to make this an emotional shocking movie that it had the opposite effect. I have no idea why the two soldiers were friends or what they had been through together. The movie is just perfect!")ĭata_string = Preparing_string("I don't feel like I know the characters at all. Several hours later after my emotions are still outside my body. It felt like I was also fighting to reach Colonel MacKenzie for two hours. Insightful, moving and an overall amazing watch.")ĭata_string = Preparing_string("I felt dirty, I felt tired, I felt hungry, I felt a will to succeed and I felt sadness when I was watching the movie. The two leading actors really grasped the concept that human contact can be so strong, especially in such awful situations as war. Cinematography is outstanding, the one shot process really makes you feel as though you are there. Print("predict_classes:",model.predict_classes(data_string))ĭata_string = Preparing_string("One of the best films I've seen in a long while. Print("predict:",model.predict(data_string)) While everything about the movie was well done I was so caught up in the two central characters that nothing else mattered. At first I was eager to see the one shot idea Sam Mendes went into this with but, after awhile, I stopped paying attention to that. I had high expectations and was not disappointed. It is by far the best movie I've seen in a very, very long time. It is a movie about the bond of men in war. Print("Test-Accuracy:", results.history)ĭata_string = Preparing_string("First off, this is NOT a war film. Model.add(layers.Dense(1, activation = "sigmoid")) Model.add(layers.Dropout(0.2, noise_shape=None, seed=None)) Model.add(layers.Dense(50, activation = "relu")) Model.add(layers.Dropout(0.3, noise_shape=None, seed=None)) Model.add(layers.Dense(50, activation = "relu", input_shape=(TOP_WORDS, ))) Targets = np.array(targets).astype("float32") Targets = np.concatenate((training_targets, testing_targets), axis=0) (training_data, training_targets), (testing_data, testing_targets) = imdb.load_data(num_words=TOP_WORDS)ĭata = np.concatenate((training_data, testing_data), axis=0) Results = np.zeros((len(sequences), dimension)) Print("\nConvert to vectors:", results,"\n")ĭef vectorize(sequences, dimension = TOP_WORDS): Results = np.reshape(results,(1, TOP_WORDS)) Print("\nOriginal string:", text_string,"\n") Table = str.maketrans(omkeys(string.punctuation)) import numpy as npĭef Preparing_string(text_string, dimension = TOP_WORDS): The machine classifies reviews for new movies from the siteīased on IMDB database. In order to study this topic, I wrote a machine learning that works on keras. Scores = model.evaluate(X_test, y_test, verbose=0) Model.fit(X_train, y_train, epochs=3, callbacks=, batch_size=64) pile(loss='binary_crossentropy', optimizer='adam', metrics=) TensorBoardCallback = TensorBoard(log_dir='./logs', write_graph=True) Model.add(Dense(180,activation='sigmoid')) Model.add(Convolution1D(16, 3, padding='same')) Model.add(Convolution1D(32, 3, padding='same')) Model.add(Convolution1D(64, 3, padding='same')) # Convolutional model (3x conv, flatten, 2x dense) Model.add(Embedding(top_words, embedding_vecor_length, input_length=max_review_length)) X_test = sequence.pad_sequences(X_test, maxlen=max_review_length) X_train = sequence.pad_sequences(X_train, maxlen=max_review_length) (X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=top_words) # Using keras to load the dataset with the top_words So how do i preform a prediction to a new sentence like: "i love this movie"? from keras.datasets import imdbįrom keras.layers import LSTM, Convolution1D, Flatten, Dropoutįrom import Embedding but now i'm not sure how to predict new data since the imdb dataset is already in vectors(). I'm using keras to implement sentiment analysis model.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |