Closed sherlockliang888 closed 3 years ago
Needs PR
Are you familiar with the concept of writing the pseudocode ? Try to see if you can translate the text to pseudocode: https://www.wikihow.com/Write-Pseudocode
If not, don't worry about it, this is good enough. I will answer questions later, when available.
PR:
1. Store input text as a variable with key:
06091000: {text_ there is some texts}
If Input Textarea is not empty:
Record the current timestamp as the key
Save the input as a variable so that referring to key is equivalent to referring the text
variable = Text2backend(variable)
Print( EmotionDetecter(variable)[0]
Else:
Prompt asking for user input
2. EmotionDetector(variable), this functions reads the variable in backend, read the most recent model saved and performs an analysis, return an emotion: The input should be a string, in this case some texts. The returned variable should be stored as result1, which is a string inside of a list, like ["surprised"]
3. Text2backend(variable): Send text to backend, this functions sends the variable to backend, and returns the variable name.
4. Textlabel2backend(variable): Send text with label, which should be a dictionary, to backend, returns None.
5. Train_all(): Training all text with all labels in the backend, save the model, returns None. Read all text and apply filter (remove stopwords, word2vec etc) Apply algorithms and train the model Save the model
6. User choose whether they are satisfied with the emotion result with radio buttons (first selected by default):
Example for "yes":
06091000: {text: "there is some texts", result: ["surprised", "surprised"][1]}
If "yes" is checked: Duplicate the result1 and append to the list so that the list has 2 identical strings Textlabel2backend(variable) --> Send result to backend for storage/training Return to Homepage Else if "no" is checked: Hide this current section Show "Correction" Section
7. User choose the correct emotion (first selected by default):
Example for "happy" selected:
06091000: {text: "there is some texts", result: ["surprised", "happy"][1]}
If "happy" is checked:
Append result1 with "happy"
Textlabel2backend(variable) --> Send result to backend for storage/training
Train_all() to train and save the model for prediction next time
Return to Homepage
Else if "sad" is checked:
Append result1 with "sad"
Textlabel2backend(variable) --> Send result to backend for storage/training
Train_all() to train and save the model for prediction next time
Return to Homepage
Else if ...
End
Needs PR (I will add more if I can come up with more)
Thank you, I will review it as soon as I am done with one very important task I am doing now.
Thanks, please take your time, I will go work on other tasks.
Great work, this is exactly what we want !