<jupyter_start><jupyter_text>__Rudent__  Imports<jupyter_code>import tensorflow as tf
import numpy as np
import pickle
model = tf.keras.models.load_model('rudent.h5')
t = pickle.load(open('tokenizer.pickle', 'rb'))<jupyter_output><empty_output><jupyter_text>Rudent Function<jupyter_code>def rudent(sen):
    tsens = t.pad(t.sen2seq(t.sanatize([sen])),41)
    classes = ['Rude', 'Not Rude']
    return classes[int(np.round(model.predict(tsens)))]<jupyter_output><empty_output><jupyter_text>Try it out:<jupyter_code>rudent("Say Something I'm giving up on you")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14795918367346939, 'fraction_numerical': 0.006802721088435374, 'mean_word_length': 8.5, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '177137', 'license': 'MIT', 'n_tokens_mistral': 239, 'n_tokens_neox': 234, 'n_words': 34, 'path': 'notebooks/rudent.ipynb', 'repo_name': 'priyanshu-bisht/Rudent', 'size': '588'}