from transformers import pipeline import gradio as gr from nltk.sentiment.vader import SentimentIntensityAnalyzer import nltk nltk.download('vader_lexicon') zero_shot_classifier = pipeline("zero-shot-classification" , model='roberta-large-mnli') spam_detector = pipeline("text-classification", model="madhurjindal/autonlp-Gibberish-Detector-492513457") issues = ["Misconduct" , "Negligence" , "Discrimination" , "Corruption" , "Violation of Rights" , "Inefficiency" , "Unprofessional Conduct", "Response Time" , "Use of Firearms" , "Property Damage"] apprecn = ["Tech-Savvy Staff" , "Co-operative Staff" , "Well-Maintained Premises" , "Responsive Staff"] def spam_detection(input_text): return spam_detector(input_text)[0]['label'] == 'clean' def sentiment_analysis(input_text): score = SentimentIntensityAnalyzer().polarity_scores(input_text) if score['neg']>score['pos']: return "Negative Feedback" elif score['neg']