(self, text)
return sentimentInfo["classes"][tf.keras.backend.get_value(prediction)[0]]
function to perform sentiment analysis text_classification

    :param text: text sent in/from written query to be analyzed
function to perform sentiment analysis text_classification
function to perform sentiment analysis text_classification
def classify_text(self, text):
    """
    function to perform sentiment analysis text_classification

    :param text: text sent in/from written query to be analyzed
    """

    sentimentInfo = self.models.get("text_classification")
    vocab = sentimentInfo["vocabulary"]
    # Clean up text
    text = lemmatize_text(text_clean_up([text]))
    # Encode text
    text = encode_text(vocab, text)
    text = sequence.pad_sequences(text, sentimentInfo["max_text_length"])
    model = sentimentInfo["model"]
    prediction = tf.keras.backend.argmax(model.predict(text))
    return sentimentInfo["classes"][tf.keras.backend.get_value(prediction)[0]]
def classify_text ( self , text ) : sentimentInfo = self . models . get ( "text_classification" ) vocab = sentimentInfo [ "vocabulary" ] # Clean up text text = lemmatize_text ( text_clean_up ( [ text ] ) ) # Encode text text = encode_text ( vocab , text ) text = sequence . pad_sequences ( text , sentimentInfo [ "max_text_length" ] ) model = sentimentInfo [ "model" ] prediction = tf . keras . backend . argmax ( model . predict ( text ) ) return sentimentInfo [ "classes" ] [ tf . keras . backend . get_value ( prediction ) [ 0 ] ]