Update app.py
Browse files
app.py
CHANGED
@@ -35,33 +35,33 @@ with gr.Blocks() as user_story_interface:
|
|
35 |
with gr.Row():
|
36 |
with gr.Column(scale=1):
|
37 |
user_story_chatbot = gr.Chatbot(
|
38 |
-
[
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
],
|
43 |
],
|
44 |
-
height="
|
|
|
45 |
)
|
46 |
user_story_input = gr.Textbox(
|
47 |
label="Message OntoChat",
|
48 |
placeholder="Please type your message here and press Shift + Enter to interact with the chatbot:",
|
49 |
-
max_lines=
|
50 |
-
lines =
|
51 |
)
|
52 |
elicitation_questions_dataset = gr.Dataset(
|
53 |
components=[user_story_input],
|
54 |
-
label="
|
55 |
type="index",
|
56 |
samples=[
|
57 |
-
["
|
58 |
-
["
|
59 |
-
["
|
60 |
-
["
|
61 |
-
["
|
62 |
-
["
|
63 |
-
["
|
64 |
-
["
|
65 |
],
|
66 |
samples_per_page = 10
|
67 |
)
|
@@ -80,11 +80,19 @@ with gr.Blocks() as user_story_interface:
|
|
80 |
with gr.Blocks() as cq_interface:
|
81 |
with gr.Row():
|
82 |
with gr.Column():
|
83 |
-
cq_chatbot = gr.Chatbot(
|
84 |
-
[
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
cq_input = gr.Textbox(
|
89 |
label="Chatbot input",
|
90 |
placeholder="Please type your message here and press Enter to interact with the chatbot:"
|
@@ -147,7 +155,7 @@ clustering_interface = gr.Interface(
|
|
147 |
description="This is the third step of OntoChat. Please copy the generated competency questions from the previous "
|
148 |
"step and run the clustering algorithm to group the competency questions based on their topics. From "
|
149 |
"our experience, LLM clustering has the best performance.",
|
150 |
-
|
151 |
)
|
152 |
|
153 |
with gr.Blocks() as testing_interface:
|
@@ -196,4 +204,4 @@ demo = gr.TabbedInterface(
|
|
196 |
)
|
197 |
|
198 |
if __name__ == "__main__":
|
199 |
-
demo.launch(share=True)
|
|
|
35 |
with gr.Row():
|
36 |
with gr.Column(scale=1):
|
37 |
user_story_chatbot = gr.Chatbot(
|
38 |
+
value=[
|
39 |
+
{"role": "assistant", "content": (
|
40 |
+
"Hello! I'm OntoChat, your trusted assistant for creating an ontology user story. Here's how I can assist you: \n\n1. I'll guide you through a sequence of questions, and you can use the provided prompt templates to craft your answers. \n\n2. You're welcome to share comments on my responses, and I'll refine them based on your feedback to ensure continuous improvement. 😊\n\nLet's get started! Could you tell me a little about the purpose of this ontology?"
|
41 |
+
)}
|
|
|
42 |
],
|
43 |
+
height="472px",
|
44 |
+
type="messages"
|
45 |
)
|
46 |
user_story_input = gr.Textbox(
|
47 |
label="Message OntoChat",
|
48 |
placeholder="Please type your message here and press Shift + Enter to interact with the chatbot:",
|
49 |
+
max_lines=4,
|
50 |
+
lines = 4
|
51 |
)
|
52 |
elicitation_questions_dataset = gr.Dataset(
|
53 |
components=[user_story_input],
|
54 |
+
label="Prompt Templates",
|
55 |
type="index",
|
56 |
samples=[
|
57 |
+
["Create Persona"],
|
58 |
+
["Create User Goal"],
|
59 |
+
["Create Actions"],
|
60 |
+
["Create Keywords"],
|
61 |
+
["Create Current Methods"],
|
62 |
+
["Create Challenges"],
|
63 |
+
["Create New Methods"],
|
64 |
+
["Create Outcomes"]
|
65 |
],
|
66 |
samples_per_page = 10
|
67 |
)
|
|
|
80 |
with gr.Blocks() as cq_interface:
|
81 |
with gr.Row():
|
82 |
with gr.Column():
|
83 |
+
cq_chatbot = gr.Chatbot(
|
84 |
+
value=[
|
85 |
+
{
|
86 |
+
"role": "assistant",
|
87 |
+
"content": (
|
88 |
+
"I am OntoChat, your conversational ontology engineering assistant. Here is the second step of "
|
89 |
+
"the system. Please give me your user story and tell me how many competency questions you want "
|
90 |
+
"me to generate from the user story."
|
91 |
+
)
|
92 |
+
}
|
93 |
+
],
|
94 |
+
type="messages"
|
95 |
+
)
|
96 |
cq_input = gr.Textbox(
|
97 |
label="Chatbot input",
|
98 |
placeholder="Please type your message here and press Enter to interact with the chatbot:"
|
|
|
155 |
description="This is the third step of OntoChat. Please copy the generated competency questions from the previous "
|
156 |
"step and run the clustering algorithm to group the competency questions based on their topics. From "
|
157 |
"our experience, LLM clustering has the best performance.",
|
158 |
+
flagging_mode="never"
|
159 |
)
|
160 |
|
161 |
with gr.Blocks() as testing_interface:
|
|
|
204 |
)
|
205 |
|
206 |
if __name__ == "__main__":
|
207 |
+
demo.launch(share=True)
|