saidhanush4422 / Helium-3

0 stars 1 forks source link

Module 3.1: different moods detection -- Happy, Sad, Angry, Disgust, Surprise, Neutral, Fear. #8

Closed saidhanush4422 closed 1 year ago

saidhanush4422 commented 1 year ago

Missed Data

=IF(C2='0.4,"Neutral",=IF(C2='0.3,"Depressed",=IF(C2='0.2,"Sad",IF(C2='0.1,"Anger","Happy"))))

Forgotten Code


#tkinter
root = Tk()
root.geometry("300x200")

def process_line(line):
    # Perform operations on the line here
    print(line.upper())

def upload_file():
    filename = filedialog.askopenfilename(initialdir="/", title="Select a file", filetypes=(("Text files","*.txt"),("All Files","*.*")))
    with open(filename, "r") as f:
        text=f.read()
        i=0
        for line in f:
            process_line(line.strip())
            #emotion = analyze_emotion(text)
        emotion = analyze_emotion(text)
        print(text)
        print(emotion)

upload_button = Button(root, text="Upload File", command=upload_file)
upload_button.pack(pady=10)

root.mainloop()

uploader = widgets.FileUpload()
display(uploader)
button = widgets.Button(description= "Predict")
out = widgets.Output()

def on_button_click(_):
    with out:
        clear_output()
        try:
            imagePrediction(uploader)
        except:
            print("Please Enter the Correct Image files")

button.on_click(on_button_click)
widgets.VBox([button, out])

while True:
    text = input("Enter the text")
    emotion = analyze_emotion(text)
    print(emotion)
    if text.lower()=="quit":
        print("You have exited the prompt")
        break