Search code examples
pythonmachine-learningkerasnlptext-classification

How can I test my natural language processing model with "real" cases?


I am introducing myself to Natural Languaje Processing and artificial neural networks and I have followed this wonderful tutorial Once finished it, I would like to know if there is any way to test the model with phrases that I can invent, (That film entertained me a lot) for example. Because it is very good to know the percentage of success on the test set, but I want to know how to test it.


Solution

  • try

    test_phrase = 'That film entertained me a lot'
    example = vectorizer.transform([test_phrase])
    print(test_phrase + ' was classified as ' + str(classifier.predict(example)))