Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ model_choice = st.selectbox(
|
|
19 |
|
20 |
# Context, Subject, and Level
|
21 |
context = "You are a patent claims identifier and extractor. You will freeform text, identify any claims contained therein that may be patentable. You identify , extract, print such claims, briefly explain why each claim is patentable."
|
22 |
-
userinput = st.text_input("Input Text:", "
|
23 |
|
24 |
# Initialize OpenAI API
|
25 |
if api_key:
|
@@ -47,11 +47,11 @@ if userinput and api_key and st.button("Extract Claims",key="claims_extraction",
|
|
47 |
claims_extraction=claims_extraction_response['choices'][0]['message']['content']
|
48 |
|
49 |
# Save generated objectives to session state
|
50 |
-
st.session_state.claims_extraction = claims_extraction.strip()
|
51 |
|
52 |
# Display generated objectives
|
53 |
learning_status_placeholder.text(f"Patentable Claims Extracted!\n{claims_extraction.strip()}")
|
54 |
-
|
55 |
# Generate Lesson Plan Button
|
56 |
if st.button("Extract Claims") and api_key:
|
57 |
|
@@ -59,7 +59,7 @@ if st.button("Extract Claims") and api_key:
|
|
59 |
prompt_dict = {
|
60 |
"context": context,
|
61 |
"userinput": userinput,
|
62 |
-
"claims_extraction":
|
63 |
"tasks": [
|
64 |
{"task": "Extract Claims", "objective": "extract any wordphrases in the text provided that could be considered a patentable claim"},
|
65 |
{"task": "Extract Every Claim", "objective": "Ensure each and every wordphrase with a claim is evaluated whether or not it is patentable"},
|
@@ -73,6 +73,7 @@ if st.button("Extract Claims") and api_key:
|
|
73 |
|
74 |
"""
|
75 |
}
|
|
|
76 |
|
77 |
# Convert the dictionary to a string
|
78 |
prompt_str = str(prompt_dict)
|
|
|
19 |
|
20 |
# Context, Subject, and Level
|
21 |
context = "You are a patent claims identifier and extractor. You will freeform text, identify any claims contained therein that may be patentable. You identify , extract, print such claims, briefly explain why each claim is patentable."
|
22 |
+
userinput = st.text_input("Input Text:", "Freeform text here!")
|
23 |
|
24 |
# Initialize OpenAI API
|
25 |
if api_key:
|
|
|
47 |
claims_extraction=claims_extraction_response['choices'][0]['message']['content']
|
48 |
|
49 |
# Save generated objectives to session state
|
50 |
+
# st.session_state.claims_extraction = claims_extraction.strip()
|
51 |
|
52 |
# Display generated objectives
|
53 |
learning_status_placeholder.text(f"Patentable Claims Extracted!\n{claims_extraction.strip()}")
|
54 |
+
|
55 |
# Generate Lesson Plan Button
|
56 |
if st.button("Extract Claims") and api_key:
|
57 |
|
|
|
59 |
prompt_dict = {
|
60 |
"context": context,
|
61 |
"userinput": userinput,
|
62 |
+
"claims_extraction": claims_extraction.strip(), # Use the claims_extraction variable
|
63 |
"tasks": [
|
64 |
{"task": "Extract Claims", "objective": "extract any wordphrases in the text provided that could be considered a patentable claim"},
|
65 |
{"task": "Extract Every Claim", "objective": "Ensure each and every wordphrase with a claim is evaluated whether or not it is patentable"},
|
|
|
73 |
|
74 |
"""
|
75 |
}
|
76 |
+
|
77 |
|
78 |
# Convert the dictionary to a string
|
79 |
prompt_str = str(prompt_dict)
|