RubenPeeters commited on
Commit
31a8dd3
·
1 Parent(s): 69e0484

Updated initial prompt

Browse files
Files changed (3) hide show
  1. app.py +7 -3
  2. requirements.txt +1 -0
  3. sources/cacao.owl +0 -0
app.py CHANGED
@@ -4,7 +4,7 @@ from agents import manager_agent
4
 
5
  # Define a simple function that the Gradio app will use.
6
  # This function takes a string as input and returns its reverse.
7
- def reverse_text(text):
8
  """
9
  Reverses the input string.
10
 
@@ -14,7 +14,11 @@ def reverse_text(text):
14
  Returns:
15
  str: The reversed string.
16
  """
17
- return text[::-1]
 
 
 
 
18
 
19
  # Create the Gradio interface.
20
  # gr.Interface takes:
@@ -28,7 +32,7 @@ iface = gr.Interface(
28
  inputs=gr.Textbox(lines=2, placeholder="Enter text here...", label="Input Text"),
29
  outputs=gr.Textbox(label="Final output"),
30
  title="KGC Agents",
31
- description="Type some text into the input box, and the app will create a knowledge graph for you!"
32
  )
33
 
34
  # Launch the Gradio app.
 
4
 
5
  # Define a simple function that the Gradio app will use.
6
  # This function takes a string as input and returns its reverse.
7
+ def start_process(text):
8
  """
9
  Reverses the input string.
10
 
 
14
  Returns:
15
  str: The reversed string.
16
  """
17
+ return manager_agent.run(f"Please derive a knowledge graph from the text between <TEXT></TEXT>. Do NOT look up new facts. I want you to go through the following steps: \
18
+ Named Entity Recognition, Entity Typing, Entity Linking, Coreference Resolution, Relation Extraction, and finally Knowledge Graph Validation. \
19
+ You don't currently have a validation tool, so use your best guess. \
20
+ Do make sure that your final output is a valid RDF file. \
21
+ <TEXT>{text}</TEXT>")
22
 
23
  # Create the Gradio interface.
24
  # gr.Interface takes:
 
32
  inputs=gr.Textbox(lines=2, placeholder="Enter text here...", label="Input Text"),
33
  outputs=gr.Textbox(label="Final output"),
34
  title="KGC Agents",
35
+ description="Type some text into the input box, and the app will create a knowledge graph for you! (WIP)"
36
  )
37
 
38
  # Launch the Gradio app.
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
  smolagents[all]
2
  rdflib
 
 
1
  smolagents[all]
2
  rdflib
3
+ dotenv
sources/cacao.owl ADDED
The diff for this file is too large to render. See raw diff