EmicoBinsfinder commited on
Commit
4e42957
·
1 Parent(s): 088871e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -36,14 +36,14 @@ def bot(history):
36
  class_embeddings = pd.read_csv('Embeddings/MainClassEmbeddings.csv')
37
 
38
 
39
- def classifier(userin):
40
  clean_in = classification.clean_data(userin, type='String')
41
  in_emb = classification.sentence_embedder(clean_in, 'Model_bert')
42
 
43
  Number = 10
44
  broad_scope_predictions = classification.broad_scope_class_predictor(class_embeddings, in_emb, Number, Sensitivity='High')
45
 
46
- return broad_scope_predictions[1]
47
 
48
 
49
  # def generateresponse(history):
@@ -131,7 +131,7 @@ with gr.Blocks(title='Claimed', theme=theme) as demo:
131
  Use this tool to expand your patent claim into a description. You can also use this tool to generate abstracts and give you ideas about the benefit of an invention by changing the settings in the dropdown menu.
132
 
133
  """)
134
- gr.Dropdown(["Generate Description", "Generate Abstract", "Benefits of the invention"], label='Choose Generation Type Here')
135
  with gr.Row(scale=1, min_width=600):
136
 
137
  text1 = gr.Textbox(label="Input",
@@ -177,14 +177,14 @@ with gr.Blocks(title='Claimed', theme=theme) as demo:
177
  Click on the link to initiate either an Espacenet or Google Patents classification search using the generated classifications. You can specify which you would like using the dropdown menu.
178
  """)
179
 
180
- gr.Dropdown(["Google Patent Search", "Espacenet Patent Search"], label='Choose Search Link Here')
181
  with gr.Row(scale=1, min_width=600):
182
  userin = gr.Textbox(label="Input",
183
  placeholder='Type in your Claim/Description/Abstract Here')
184
  output = gr.Textbox(label="Output")
185
  with gr.Row():
186
  classify_btn = gr.Button("Classify")
187
- classify_btn.click(fn=classifier, inputs=userin, outputs=output)
188
 
189
 
190
  gr.Markdown("""
 
36
  class_embeddings = pd.read_csv('Embeddings/MainClassEmbeddings.csv')
37
 
38
 
39
+ def classifier(userin, searchlink):
40
  clean_in = classification.clean_data(userin, type='String')
41
  in_emb = classification.sentence_embedder(clean_in, 'Model_bert')
42
 
43
  Number = 10
44
  broad_scope_predictions = classification.broad_scope_class_predictor(class_embeddings, in_emb, Number, Sensitivity='High')
45
 
46
+ return broad_scope_predictions[1], searchlink
47
 
48
 
49
  # def generateresponse(history):
 
131
  Use this tool to expand your patent claim into a description. You can also use this tool to generate abstracts and give you ideas about the benefit of an invention by changing the settings in the dropdown menu.
132
 
133
  """)
134
+ gr.Dropdown(["Generate Description", "Generate Abstract", "Benefits of the invention"], label='Choose Generation Type Here', value='Generate Description')
135
  with gr.Row(scale=1, min_width=600):
136
 
137
  text1 = gr.Textbox(label="Input",
 
177
  Click on the link to initiate either an Espacenet or Google Patents classification search using the generated classifications. You can specify which you would like using the dropdown menu.
178
  """)
179
 
180
+ SearchType = gr.Dropdown(["Google Patent Search", "Espacenet Patent Search"], label='Choose Search Type Here', value='Google Patent Search')
181
  with gr.Row(scale=1, min_width=600):
182
  userin = gr.Textbox(label="Input",
183
  placeholder='Type in your Claim/Description/Abstract Here')
184
  output = gr.Textbox(label="Output")
185
  with gr.Row():
186
  classify_btn = gr.Button("Classify")
187
+ classify_btn.click(fn=classifier, inputs=[userin, SearchType] , outputs=output)
188
 
189
 
190
  gr.Markdown("""