ningrumdaud commited on
Commit
2b4a211
·
verified ·
1 Parent(s): f0459eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -60,7 +60,7 @@ class NounExtractor:
60
  # Collect dependency labels for the current noun phrase
61
  deps_in_phrase = {list_dep_labels[tok.i] for tok in current}
62
 
63
- # Merge logic based on 'of' construction
64
  if i + 1 < len(noun_phrases) and (doc[current.end].text in ['of', 'in', 'among', 'on', 'towards', 'to', 'for']):
65
  next_phrase = noun_phrases[i + 1]
66
  if i + 2 < len(noun_phrases) and doc[next_phrase.end].dep_ == 'pcomp':
@@ -190,7 +190,7 @@ def CogMapAnalysis(text):
190
  # Create the GUI using the 'gr' library
191
  with gr.Blocks() as demo:
192
  with gr.Column():
193
- gr.Markdown('<div style="text-align: center;"><h1><strong>CogMap</strong></h1></div> <div style="text-align: center;"><h3></h3></div>')
194
 
195
  with gr.Row():
196
  inputs = gr.Textbox(label="Input", lines=2, placeholder="Enter your text here...")
@@ -200,7 +200,7 @@ with gr.Blocks() as demo:
200
  "CogMap is a tool that lets you create cognitive maps from text."
201
  ]
202
 
203
- output = gr.Textbox(label="CogMap", lines=1, placeholder=".............")
204
  cogmap_plot = gr.Plot(label="Visualization")
205
  interface = gr.Interface(fn=CogMapAnalysis, examples=examples, inputs=inputs, outputs=[output, cogmap_plot])
206
 
 
60
  # Collect dependency labels for the current noun phrase
61
  deps_in_phrase = {list_dep_labels[tok.i] for tok in current}
62
 
63
+ # Merge logic based on 'phrases connectors' construction
64
  if i + 1 < len(noun_phrases) and (doc[current.end].text in ['of', 'in', 'among', 'on', 'towards', 'to', 'for']):
65
  next_phrase = noun_phrases[i + 1]
66
  if i + 2 < len(noun_phrases) and doc[next_phrase.end].dep_ == 'pcomp':
 
190
  # Create the GUI using the 'gr' library
191
  with gr.Blocks() as demo:
192
  with gr.Column():
193
+ gr.Markdown('<div style="text-align: center;"><h1><strong>CogMapNLP</strong></h1></div> <div style="text-align: center;"><h3></h3></div>')
194
 
195
  with gr.Row():
196
  inputs = gr.Textbox(label="Input", lines=2, placeholder="Enter your text here...")
 
200
  "CogMap is a tool that lets you create cognitive maps from text."
201
  ]
202
 
203
+ output = gr.Textbox(label="CogMap", lines=1, placeholder=" ")
204
  cogmap_plot = gr.Plot(label="Visualization")
205
  interface = gr.Interface(fn=CogMapAnalysis, examples=examples, inputs=inputs, outputs=[output, cogmap_plot])
206