faldeus0092
commited on
Commit
•
c1265c8
1
Parent(s):
2ecaf72
added more core explanation intents
Browse files- .gitignore +2 -1
- app.py +3 -3
- embeddings2.npy +3 -0
- flows.py +10 -5
- intents.py +8 -3
.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
asdf
|
2 |
__pycache__
|
3 |
-
env
|
|
|
|
1 |
asdf
|
2 |
__pycache__
|
3 |
+
env
|
4 |
+
create_embed.py
|
app.py
CHANGED
@@ -15,10 +15,10 @@ import numpy as np
|
|
15 |
from openai import OpenAI
|
16 |
|
17 |
model_en = SentenceTransformer("intfloat/multilingual-e5-base")
|
18 |
-
with open('
|
19 |
intents_embedding = np.load(f)
|
20 |
-
with open('openai_embeddings.npy', 'rb') as f:
|
21 |
-
|
22 |
|
23 |
llm = None
|
24 |
llm_chain = None
|
|
|
15 |
from openai import OpenAI
|
16 |
|
17 |
model_en = SentenceTransformer("intfloat/multilingual-e5-base")
|
18 |
+
with open('embeddings2.npy', 'rb') as f:
|
19 |
intents_embedding = np.load(f)
|
20 |
+
# with open('openai_embeddings.npy', 'rb') as f:
|
21 |
+
# openai_intents_embedding = np.load(f)
|
22 |
|
23 |
llm = None
|
24 |
llm_chain = None
|
embeddings2.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:11d4d5bddc10e123b34f9a49318833c277f3a24e1fcf6c95487fda3051b9a959
|
3 |
+
size 104576
|
flows.py
CHANGED
@@ -30,18 +30,23 @@ UNDERSTAND_STATE_FLOWS = [
|
|
30 |
"provide_subject",
|
31 |
"explain_answer",
|
32 |
"explain_answer_with_topic",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
"assess_knowledge",
|
34 |
"assess_knowledge_with_topic",
|
35 |
"recommend",
|
36 |
"recommend_with_topic",
|
37 |
"exercise",
|
38 |
"exercise_with_topic",
|
39 |
-
"exercise_multiple_question",
|
40 |
-
"exercise_multiple_question_with_topic",
|
41 |
"personal",
|
42 |
-
"
|
43 |
-
"
|
44 |
-
"unknown"
|
45 |
]
|
46 |
|
47 |
HOMEWORK_STATE_FLOWS = ["homework_with_question",
|
|
|
30 |
"provide_subject",
|
31 |
"explain_answer",
|
32 |
"explain_answer_with_topic",
|
33 |
+
"core_explanation_repeat",
|
34 |
+
"core_explanation_exercise",
|
35 |
+
"core_explanation_exercise_with_topic",
|
36 |
+
"core_explanation_video",
|
37 |
+
"core_explanation_video_with_topic",
|
38 |
+
"core_explanation_protips",
|
39 |
+
"negative_respond",
|
40 |
+
"positive_respond",
|
41 |
"assess_knowledge",
|
42 |
"assess_knowledge_with_topic",
|
43 |
"recommend",
|
44 |
"recommend_with_topic",
|
45 |
"exercise",
|
46 |
"exercise_with_topic",
|
|
|
|
|
47 |
"personal",
|
48 |
+
"unknown",
|
49 |
+
"general_intent"
|
|
|
50 |
]
|
51 |
|
52 |
HOMEWORK_STATE_FLOWS = ["homework_with_question",
|
intents.py
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
-
#@title intents.py
|
2 |
intents_sentence_similarity_en = {
|
3 |
"homework":"Intent to do exercise questions or homework. (Bantu Kerjakan PR, Bantu PR,tanya soal, tanya pr)",
|
4 |
"homework_with_question":"Curious and asking spesific questions or homework.(Bantu Kerjakan soal ini, Bisa kerjakan soal ini, Beritahu jawabannya)",
|
5 |
"explain_answer":"Wants explanation/study about the spesific answer (Belajar Lebih Dalam/Ceritakan lebih lanjut/jelaskan dari awal/jelaskan/jelasin lebih lanjut/belum paham)",
|
6 |
"explain_answer_with_topic":"Wants explanation/study about spesific topics (Belajar Lebih Dalam terkait/Ceritakan lebih lanjut bab /jelaskan dari awal materi/jelaskan lebih lanjut pelajaran /belum paham terkait materi)",
|
7 |
"core_explanation_repeat":"Repeat the explanation of a question (Jelasin ulang/Jelaskan ulang/Jelaskan lagi)",
|
8 |
-
"core_explanation_exercise":"Example questions from
|
9 |
-
"
|
|
|
|
|
10 |
"core_explanation_protips":"Explanation or questions about Tips, tricks, and effective methods (protips/tips dan trik)",
|
11 |
"negative_respond":"Did not understand the explanation (aku belum paham, masih belum paham, aku gangerti, aku belum mengerti, masih bingung, aku kesusahan)",
|
12 |
"positive_respond":"Understanding the explanation (aku sudah paham, oke paham kak, oke mengerti, oke aman, lanjut kak)",
|
@@ -40,7 +41,9 @@ intents = ['homework',
|
|
40 |
'explain_answer_with_topic',
|
41 |
'core_explanation_repeat',
|
42 |
'core_explanation_exercise',
|
|
|
43 |
'core_explanation_video',
|
|
|
44 |
'core_explanation_protips',
|
45 |
'negative_respond',
|
46 |
'positive_respond',
|
@@ -74,7 +77,9 @@ chatbot_intents = {
|
|
74 |
"explain_answer_with_topic":"Student is curious or wants more explanation about specific topics (Belajar Lebih Dalam terkait termodinamika/Ceritakan lebih lanjut bab matematika integral/jelaskan dari awal materi mitosis/jelaskan lebih lanjut pelajaran listrik/belum paham terkait materi past tenses)",
|
75 |
"core_explanation_repeat":"Student wants repeat explanation (Jelasin ulang/Jelaskan ulang/Jelaskan lagi)",
|
76 |
"core_explanation_exercise":"Student wants explain with exercise (Contoh Soal/Contoh soal dong/bahas dengan soal)",
|
|
|
77 |
"core_explanation_video":"Student wants explanation with video (Video Penjelasan/Bahas dengan video/mau video penjelasan)",
|
|
|
78 |
"core_explanation_protips":"Student wants tips and tricks (protips/tips dan trik)",
|
79 |
"negative_respond":"Student respond they dont understand the explanation (aku belum paham, masih belum paham, aku gangerti, aku belum mengerti, masih bingung)",
|
80 |
"positive_respond":"Student respond they understand the explanation (aku sudah paham, oke paham kak, oke mengerti, oke aman, lanjut kak)",
|
|
|
|
|
1 |
intents_sentence_similarity_en = {
|
2 |
"homework":"Intent to do exercise questions or homework. (Bantu Kerjakan PR, Bantu PR,tanya soal, tanya pr)",
|
3 |
"homework_with_question":"Curious and asking spesific questions or homework.(Bantu Kerjakan soal ini, Bisa kerjakan soal ini, Beritahu jawabannya)",
|
4 |
"explain_answer":"Wants explanation/study about the spesific answer (Belajar Lebih Dalam/Ceritakan lebih lanjut/jelaskan dari awal/jelaskan/jelasin lebih lanjut/belum paham)",
|
5 |
"explain_answer_with_topic":"Wants explanation/study about spesific topics (Belajar Lebih Dalam terkait/Ceritakan lebih lanjut bab /jelaskan dari awal materi/jelaskan lebih lanjut pelajaran /belum paham terkait materi)",
|
6 |
"core_explanation_repeat":"Repeat the explanation of a question (Jelasin ulang/Jelaskan ulang/Jelaskan lagi)",
|
7 |
+
"core_explanation_exercise":"Example questions from explanation. (Contoh Soal/Contoh soal dong/bahas dengan soal)",
|
8 |
+
"core_explanation_exercise_with_topic":"Example questions from explanation. (Contoh Soal/Contoh soal dong/bahas dengan soal)",
|
9 |
+
"core_explanation_video":"Example questions with a video. (Video Penjelasan/Bahas dengan video/mau video penjelasan)",
|
10 |
+
"core_explanation_video_with_topic":"Example questions with a video. (Video Penjelasan/Bahas dengan video/mau video penjelasan)",
|
11 |
"core_explanation_protips":"Explanation or questions about Tips, tricks, and effective methods (protips/tips dan trik)",
|
12 |
"negative_respond":"Did not understand the explanation (aku belum paham, masih belum paham, aku gangerti, aku belum mengerti, masih bingung, aku kesusahan)",
|
13 |
"positive_respond":"Understanding the explanation (aku sudah paham, oke paham kak, oke mengerti, oke aman, lanjut kak)",
|
|
|
41 |
'explain_answer_with_topic',
|
42 |
'core_explanation_repeat',
|
43 |
'core_explanation_exercise',
|
44 |
+
'core_explanation_exercise_with_topic',
|
45 |
'core_explanation_video',
|
46 |
+
'core_explanation_video_with_topic',
|
47 |
'core_explanation_protips',
|
48 |
'negative_respond',
|
49 |
'positive_respond',
|
|
|
77 |
"explain_answer_with_topic":"Student is curious or wants more explanation about specific topics (Belajar Lebih Dalam terkait termodinamika/Ceritakan lebih lanjut bab matematika integral/jelaskan dari awal materi mitosis/jelaskan lebih lanjut pelajaran listrik/belum paham terkait materi past tenses)",
|
78 |
"core_explanation_repeat":"Student wants repeat explanation (Jelasin ulang/Jelaskan ulang/Jelaskan lagi)",
|
79 |
"core_explanation_exercise":"Student wants explain with exercise (Contoh Soal/Contoh soal dong/bahas dengan soal)",
|
80 |
+
"core_explanation_exercise_with_topic":"Student wants explain with exercise (Contoh Soal integral/Contoh soal stikiometri dong/bahas dengan soal fotosintesis dong)",
|
81 |
"core_explanation_video":"Student wants explanation with video (Video Penjelasan/Bahas dengan video/mau video penjelasan)",
|
82 |
+
"core_explanation_video_with_topic":"Student wants explanation with video and provides topics (Video Penjelasan laju reaksi/Bahas dengan video integral/mau video penjelasan fotositesis)",
|
83 |
"core_explanation_protips":"Student wants tips and tricks (protips/tips dan trik)",
|
84 |
"negative_respond":"Student respond they dont understand the explanation (aku belum paham, masih belum paham, aku gangerti, aku belum mengerti, masih bingung)",
|
85 |
"positive_respond":"Student respond they understand the explanation (aku sudah paham, oke paham kak, oke mengerti, oke aman, lanjut kak)",
|