Spaces:
Runtime error
Runtime error
EmicoBinsfinder
commited on
Commit
·
2dd90fa
1
Parent(s):
3bfefbb
Update app.py
Browse files
app.py
CHANGED
@@ -182,14 +182,12 @@ def clean_data(input, type='Dataframe'):
|
|
182 |
row = ' '.join(wonum)
|
183 |
return row
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
def classifier(userin):
|
188 |
clean_in = clean_data(userin, type='String')
|
189 |
in_emb = sentence_embedder(clean_in, 'Model_bert')
|
190 |
|
191 |
Number = 10
|
192 |
-
broad_scope_predictions = broad_scope_class_predictor(class_embeddings, in_emb, Number, Sensitivity='High')
|
193 |
|
194 |
return broad_scope_predictions
|
195 |
|
@@ -292,15 +290,18 @@ def claim_selector(userin, dropd):
|
|
292 |
|
293 |
def desc_selector(userin, dropd):
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
|
300 |
return PROMPT
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
|
305 |
############# GRADIO APP ###############
|
306 |
|
@@ -343,7 +344,7 @@ with gr.Blocks(title='Claimed', theme=theme) as demo:
|
|
343 |
gr.Markdown("""
|
344 |
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.
|
345 |
""")
|
346 |
-
Descriptionchoices = gr.Dropdown(["Generate Description", "Generate Abstract", "
|
347 |
with gr.Row(scale=1, min_width=600):
|
348 |
|
349 |
text1 = gr.Textbox(label="Input",
|
|
|
182 |
row = ' '.join(wonum)
|
183 |
return row
|
184 |
|
185 |
+
def classifier(userin, SearchType):
|
|
|
|
|
186 |
clean_in = clean_data(userin, type='String')
|
187 |
in_emb = sentence_embedder(clean_in, 'Model_bert')
|
188 |
|
189 |
Number = 10
|
190 |
+
broad_scope_predictions = broad_scope_class_predictor(class_embeddings, in_emb, SearchType, Number, Sensitivity='High')
|
191 |
|
192 |
return broad_scope_predictions
|
193 |
|
|
|
290 |
|
291 |
def desc_selector(userin, dropd):
|
292 |
|
293 |
+
if dropd == "What are the Benefits/Technical Effects":
|
294 |
+
PROMPT = f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
295 |
+
### Instruction:
|
296 |
+
What are the Benefits/Technical Effects of the following invention: {userin}
|
297 |
+
### Response:"""
|
298 |
+
else:
|
299 |
+
PROMPT = f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
300 |
+
### Instruction:
|
301 |
+
{dropd} for a patent application for the following invention: {userin}
|
302 |
+
### Response:"""
|
303 |
|
304 |
return PROMPT
|
|
|
|
|
|
|
305 |
|
306 |
############# GRADIO APP ###############
|
307 |
|
|
|
344 |
gr.Markdown("""
|
345 |
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.
|
346 |
""")
|
347 |
+
Descriptionchoices = gr.Dropdown(["Generate a Description", "Generate a Abstract", "What are the Benefits/Technical Effects"], label='Choose Generation Type Here')
|
348 |
with gr.Row(scale=1, min_width=600):
|
349 |
|
350 |
text1 = gr.Textbox(label="Input",
|