lorenpe2 commited on
Commit
254630f
·
1 Parent(s): 2b6660e

FEAT: Example data

Browse files
Files changed (2) hide show
  1. app.py +18 -3
  2. data/example_data.py +2 -0
app.py CHANGED
@@ -68,7 +68,11 @@ def get_evaluation_data(_context: List) -> List[Tuple[List, str, str]]:
68
 
69
 
70
  option = st.selectbox("Choose type of input:",
71
- ["01 - String (one turn per line)", "02 - JSON (aggregated)"])
 
 
 
 
72
 
73
  with st.form("input_text"):
74
  if "01" in option:
@@ -89,8 +93,19 @@ with st.form("input_text"):
89
  ax.pie([prop_follow, prop_not_follow], labels=["Probability - Follow", "Probability - Not Follow"],
90
  autopct='%1.1f%%')
91
  st.pyplot(fig)
92
- elif "02" in option:
93
- context = st.text_area("Insert JSON here:")
 
 
 
 
 
 
 
 
 
 
 
94
  if "{" in context:
95
  evaluation_data = get_evaluation_data(_context=json.loads(context))
96
  results = []
 
68
 
69
 
70
  option = st.selectbox("Choose type of input:",
71
+ ["01 - String (one turn per line)",
72
+ "02 - JSON (aggregated)",
73
+ "03 - JSON (example CA-OOD)",
74
+ "04 - JSON (example Elysai)"])
75
+
76
 
77
  with st.form("input_text"):
78
  if "01" in option:
 
93
  ax.pie([prop_follow, prop_not_follow], labels=["Probability - Follow", "Probability - Not Follow"],
94
  autopct='%1.1f%%')
95
  st.pyplot(fig)
96
+ elif "02" in option or "03" in option or "04" in option:
97
+ from data.example_data import ca_ood, elysai
98
+ choices = [ca_ood, elysai]
99
+ option: str
100
+ match option.split("-")[0].strip():
101
+ case "03":
102
+ text = json.dumps(choices[0])
103
+ case "04":
104
+ text = json.dumps(choices[1])
105
+ case _:
106
+ text = ""
107
+ context = st.text_area("Insert JSON here:", value=str(text))
108
+
109
  if "{" in context:
110
  evaluation_data = get_evaluation_data(_context=json.loads(context))
111
  results = []
data/example_data.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ca_ood = [{"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I prefer apple pies"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["My cat is very friendly"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Id like to go to the beach"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im not sure what to do"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["This is too hard"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I dont like chocolate"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["the sky is blue"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I prefer ice cream"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im going to the park"]}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": [], "not-coherent": ["sushi is delicious"]}}}, {"context": ["Do you prefer reading a printed book, or using an e-book reader?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I prefer watching movies"]}}}, {"context": ["Do you prefer reading a printed book, or using an e-book reader?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I love travelling"]}}}, {"context": ["Do you prefer reading a printed book, or using an e-book reader?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like playing video games"]}}}, {"context": ["Do you prefer reading a printed book, or using an e-book reader?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like listening to music"]}}}, {"context": ["Do you prefer reading a printed book, or using an e-book reader?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like reading magazines"]}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to go to the beach"]}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I bake cookies"]}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to go camping"]}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to play video games"]}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to watch movies"]}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to go swimming"]}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I hate the color blue"]}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to watch movies"]}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I prefer to read magazines"]}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to listen to music"]}}}, {"context": ["What is your favorite type of book?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to go swimming"]}}}, {"context": ["What type of books do you read?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Godfather is my favorite movie"]}}}, {"context": ["Do you have a favorite book?"], "answers": {"generated": {"coherent": [], "not-coherent": ["The moon is round"]}}}, {"context": ["What type of books do you like?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Fish can fly"]}}}, {"context": ["Do you like to read books?"], "answers": {"generated": {"coherent": [], "not-coherent": ["The sea is full of sharks"]}}}, {"context": ["What type of books do you like to read?"], "answers": {"generated": {"coherent": ["I prefer fiction books"], "not-coherent": []}}}, {"context": ["What type of books do you prefer to read?"], "answers": {"generated": {"coherent": ["I usually read fantasy books"], "not-coherent": []}}}, {"context": ["Do you have a favorite genre of books?"], "answers": {"generated": {"coherent": ["Im a fan of historical fiction"], "not-coherent": []}}}, {"context": ["Do you have any favorite authors?"], "answers": {"generated": {"coherent": ["I love to read books by J.K. Rowling"], "not-coherent": []}}}, {"context": ["What kind of books do you usually read?"], "answers": {"generated": {"coherent": ["I usually read mystery novels"], "not-coherent": []}}}, {"context": ["Do you have a favorite place to read books?"], "answers": {"generated": {"coherent": ["At the library"], "not-coherent": []}}}, {"context": ["What do you usually read books on?"], "answers": {"generated": {"coherent": ["My laptop"], "not-coherent": []}}}, {"context": ["Where do you prefer to read books?"], "answers": {"generated": {"coherent": ["On the couch"], "not-coherent": []}}}, {"context": ["Whats your favorite place to read books?"], "answers": {"generated": {"coherent": ["At the beach"], "not-coherent": []}}}, {"context": ["Where do you read books most often?"], "answers": {"generated": {"coherent": ["In my bed"], "not-coherent": []}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": ["They are too simplistic"], "not-coherent": []}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": ["I dont find them entertaining"], "not-coherent": []}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": ["The stories are too predictable"], "not-coherent": []}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": ["The art style isnt to my taste"], "not-coherent": []}}}, {"context": ["Why do you hate comics?"], "answers": {"generated": {"coherent": ["I dont like the dialogue"], "not-coherent": []}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": ["I read superhero comics"], "not-coherent": []}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": ["I like horror comics"], "not-coherent": []}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": ["I read sci-fi comics"], "not-coherent": []}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": ["Im into anime comics"], "not-coherent": []}}}, {"context": ["What kind of comic books do you read?"], "answers": {"generated": {"coherent": ["I read fantasy comics"], "not-coherent": []}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": ["I saw the movie first"], "not-coherent": []}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": ["I read the book first"], "not-coherent": []}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": ["I did it the other way"], "not-coherent": []}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": ["I read the book before watching the movie"], "not-coherent": []}}}, {"context": ["Did you see the movie first and then read the book, or the other way around?"], "answers": {"generated": {"coherent": ["I watched the movie first"], "not-coherent": []}}}, {"context": ["What do you think of the new Matrix movie?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I cant swim"]}}}, {"context": ["How would you rate the new Matrix?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I love to cook"]}}}, {"context": ["What did you think of the new Matrix movie?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im a great singer"]}}}, {"context": ["How did you like the new Matrix movie?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I want to go to the beach"]}}}, {"context": ["What did you think about the new Matrix movie?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im a good dancer"]}}}, {"context": ["What did you think about the new Matrix movie?"], "answers": {"generated": {"coherent": ["It was incredibly well made"], "not-coherent": []}}}, {"context": ["What did you think about the new Matrix movie?"], "answers": {"generated": {"coherent": ["The effects were top-notch"], "not-coherent": []}}}, {"context": ["What did you think about the new Matrix movie?"], "answers": {"generated": {"coherent": ["The story was really engaging"], "not-coherent": []}}}, {"context": ["What did you think about the new Matrix movie?"], "answers": {"generated": {"coherent": ["The acting was outstanding"], "not-coherent": []}}}, {"context": ["What did you think about the new Matrix movie?"], "answers": {"generated": {"coherent": ["It was a thrilling movie experience"], "not-coherent": []}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I dont like horror movies"]}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I play video games"]}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I go to the beach"]}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to eat pizza"]}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to watch documentaries"]}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": ["I look for interesting plots"], "not-coherent": []}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": ["I consider the genre"], "not-coherent": []}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": ["I check reviews"], "not-coherent": []}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": ["I look for actors I like"], "not-coherent": []}}}, {"context": ["What makes you choose a particular movie to watch?"], "answers": {"generated": {"coherent": ["I listen to recommendations"], "not-coherent": []}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": [], "not-coherent": ["building a website is hard"]}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I prefer reading books"]}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": [], "not-coherent": ["mountain climbing is dangerous"]}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I like to play sports"]}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": [], "not-coherent": ["doing a puzzle is fun"]}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": ["mint chocolate chip"], "not-coherent": []}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": ["cookies and cream"], "not-coherent": []}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": ["strawberry"], "not-coherent": []}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": ["coffee"], "not-coherent": []}}}, {"context": ["Whats your favorite ice cream flavor?"], "answers": {"generated": {"coherent": ["chocolate chip cookie dough"], "not-coherent": []}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": [], "not-coherent": ["the sky is blue"]}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im going on vacation"]}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": [], "not-coherent": ["the temperature is rising"]}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im going to the store"]}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I love to cook"]}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": ["I have an early morning shift"], "not-coherent": []}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": ["I am too anxious to fall asleep"], "not-coherent": []}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": ["I am worried about tomorrow"], "not-coherent": []}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": ["I have too much on my mind"], "not-coherent": []}}}, {"context": ["Whats usually the reason you dont sleep longer?"], "answers": {"generated": {"coherent": ["I am not getting enough rest"], "not-coherent": []}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I go to the beach every day"]}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I go for a walk in the park"]}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": [], "not-coherent": ["I bought a new car last month"]}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im going to the movies tonight"]}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": [], "not-coherent": ["Im going to the library tomorrow"]}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": ["I usually shop online"], "not-coherent": []}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": ["I get my clothes from the mall"], "not-coherent": []}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": ["I go to my favourite boutique"], "not-coherent": []}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": ["I look for good deals in department stores"], "not-coherent": []}}}, {"context": ["Where do you buy new wear?"], "answers": {"generated": {"coherent": ["I like to thrift shop"], "not-coherent": []}}}]
2
+ elysai = [{"context": [ "Good evening! My name is Maya.", "Maya I'm studying right now but I feel like something chin while I'm studying what should I do", "Well, I'm glad that I'm talking with you! Is there something worrying you?", "yes I worried about marks in the next exam" ], "answers": { "real": { "coherent": [], "non-coherent": ["Do you often feel as if you were part of a spiritual force on which all life depends?"] }, "generated": { "coherent": ["Have you been studying hard?"], "non-coherent": ["What kind of chills?"] } } }, { "context": [ "Would you like to chat about animals now?", "agadoo", "Do you have any thoughts on that?", "iPhones" ], "answers": { "real": { "coherent": ["Do you feel like doing something else?"], "non-coherent": [] }, "generated": { "coherent": ["I'm not sure how iPhones are related to animals. Could you tell me more about your interest in animals?"], "non-coherent": ["That's great! Do you own a pet?"] } } }, { "context": [ "What thoughts have been going through your mind lately?", "I have no thoughts lately" ], "answers": { "real": { "coherent": ["I find that hard to believe. Really nothing?"], "non-coherent": [ ] }, "generated": { "coherent": ["Have you been feeling overwhelmed recently?", "Maybe you are just trying to find some clarity or peace of mind.", "That's understandable. Is there anything in particular that's been causing you to feel this way?"], "non-coherent": ["Banana pancakes are the way to go!", "I think flying unicorns are real!", "Oh okay, that sounds nice.", "How about you?"] } } }, { "context": [ "What thoughts have been going through your mind lately?", "I have no thoughts lately", "I find that hard to believe. Really nothing?", "only money I can say cuz I need more money this year than last year" ], "answers": { "real": { "coherent": [], "non-coherent": [ "Have you experienced a sense of contact with a spiritual force?" ] }, "generated": { "coherent": ["Money can be a real source of stress. Have you been thinking of ways to increase your income?", "I don't understand what you're saying.", "Have you looked into any new sources of income or are you just relying on the same sources as last year?", "That's understandable."], "non-coherent": ["That's interesting. What color is your shirt?", "What kind of music do you like?", " What did you have for breakfast yesterday?", "Can you solve this math problem?", "What color is your hair?"] } } }, { "context": [ "Hello!", "I faced rejection 2 months ago and this take out my energy" ], "answers": { "real": { "coherent": [], "non-coherent": ["Are you sleeping well?"] }, "generated": { "coherent": ["That sounds really tough. How are you feeling now?", "I'm so sorry to hear that. Can I ask what happened?", "It's understandable that something like that would take away your energy. Can I help in any way?"], "non-coherent": ["I like pizza", "What color is your hair?", "Let's go for a walk", "What do you like to do in your free time?", "What do you think about aliens?", "Have you been able to find new opportunities?"] } } }, { "context": [ "I hope you can at least trust me. What do you think?", "no I cannot trust you I don't know who you are" ], "answers": { "real": { "coherent": ["Oh, okay. You can keep your secrets, they're yours and only yours after all. Even so, I'll be still here for you, ready to talk about anything. Shall we continue?"], "non-coherent": [] }, "generated": { "coherent": ["I'm sorry you feel that way. Can you tell me why you don't trust me?", "Can I tell you a bit more about myself so you can get to know me better?", "That's understandable."], "non-coherent": ["Oh, okay. What are your hobbies?", "Have you been feeling ok lately?", "Do you know about artificial intelligence?", "What would you like to do next?"] } } } ]