Spaces:
Build error
Build error
Add Streamlit app for patentability score prediction
Browse files
app.py
CHANGED
|
@@ -22,20 +22,22 @@ st.write("Select a patent application to evaluate its patentability.")
|
|
| 22 |
application_numbers = df['application_number'].unique()
|
| 23 |
selected_application = st.selectbox("Select Application Filing Number", application_numbers)
|
| 24 |
|
| 25 |
-
# Retrieve
|
| 26 |
if selected_application:
|
| 27 |
patent_info = df[df['application_number'] == selected_application].iloc[0]
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
# Display the
|
| 32 |
-
st.text_area("
|
| 33 |
-
st.text_area("
|
| 34 |
|
| 35 |
# Submit button
|
| 36 |
if st.button("Get Patentability Score"):
|
| 37 |
-
# Prepare the input text
|
| 38 |
-
input_text = f"{
|
| 39 |
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding=True)
|
| 40 |
|
| 41 |
# Get the model prediction
|
|
|
|
| 22 |
application_numbers = df['application_number'].unique()
|
| 23 |
selected_application = st.selectbox("Select Application Filing Number", application_numbers)
|
| 24 |
|
| 25 |
+
# Retrieve relevant information
|
| 26 |
if selected_application:
|
| 27 |
patent_info = df[df['application_number'] == selected_application].iloc[0]
|
| 28 |
+
|
| 29 |
+
# Example of using invention title and decision instead
|
| 30 |
+
invention_title = patent_info['invention_title']
|
| 31 |
+
decision = patent_info['decision']
|
| 32 |
|
| 33 |
+
# Display the invention title and decision
|
| 34 |
+
st.text_area("Invention Title", invention_title, height=150)
|
| 35 |
+
st.text_area("Current Decision", decision, height=150)
|
| 36 |
|
| 37 |
# Submit button
|
| 38 |
if st.button("Get Patentability Score"):
|
| 39 |
+
# Prepare the input text using available fields
|
| 40 |
+
input_text = f"{invention_title} {decision}"
|
| 41 |
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding=True)
|
| 42 |
|
| 43 |
# Get the model prediction
|