khanfou
commited on
Commit
β’
9549aab
1
Parent(s):
d3ada56
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,6 @@ PAN = df['patent_number'].drop_duplicates()
|
|
23 |
|
24 |
st.title('Harvard USPTO Patentability Score')
|
25 |
#make_choice = st.sidebar.selectbox('Select the Patent Application Number:', PAN)
|
26 |
-
#make_choice = st.sidebar.selectbox('Select the Patent Application Number:', PAN)
|
27 |
|
28 |
#####NEW
|
29 |
with st.form("patent-form"):
|
@@ -37,15 +36,14 @@ with st.form("patent-form"):
|
|
37 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
38 |
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
39 |
|
40 |
-
abstract = df['abstract'].loc[df['patent_number'] == make_choice]
|
41 |
|
42 |
-
|
43 |
-
X_train = abstract.to_string()
|
44 |
-
|
45 |
#X_train = abstract.values.tolist()
|
46 |
results = classifier(X_train, truncation=True)
|
47 |
-
|
48 |
-
#score = results['score']
|
49 |
for result in results:
|
50 |
print(result)
|
51 |
score = result['score']
|
@@ -61,14 +59,9 @@ abstract = df["abstract"].loc[df["patent_number"] == make_choice]
|
|
61 |
st.subheader(':red[Patent Application]')
|
62 |
st.subheader(':red[Abstract:]')
|
63 |
st.info(abstract)
|
64 |
-
#st.markdown(f"Publication abstract is **{abstract}** π")
|
65 |
|
66 |
|
67 |
claims = df["claims"].loc[df["patent_number"] == make_choice]
|
68 |
st.subheader(':red[Claim:]')
|
69 |
st.info(claims)
|
70 |
-
#st.markdown(f"Publication Claim is **{claims}** π")
|
71 |
-
|
72 |
-
#form = st.form(key='patent-form')
|
73 |
-
#submit = form.sidebar.form_submit_button('Submit')
|
74 |
|
|
|
23 |
|
24 |
st.title('Harvard USPTO Patentability Score')
|
25 |
#make_choice = st.sidebar.selectbox('Select the Patent Application Number:', PAN)
|
|
|
26 |
|
27 |
#####NEW
|
28 |
with st.form("patent-form"):
|
|
|
36 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
37 |
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
38 |
|
39 |
+
#abstract = df['abstract'].loc[df['patent_number'] == make_choice]
|
40 |
|
41 |
+
decision = df['decision'].loc[df['patent_number'] == make_choice]
|
42 |
+
#X_train = abstract.to_string()
|
43 |
+
X_train = decision.to_string()
|
44 |
#X_train = abstract.values.tolist()
|
45 |
results = classifier(X_train, truncation=True)
|
46 |
+
|
|
|
47 |
for result in results:
|
48 |
print(result)
|
49 |
score = result['score']
|
|
|
59 |
st.subheader(':red[Patent Application]')
|
60 |
st.subheader(':red[Abstract:]')
|
61 |
st.info(abstract)
|
|
|
62 |
|
63 |
|
64 |
claims = df["claims"].loc[df["patent_number"] == make_choice]
|
65 |
st.subheader(':red[Claim:]')
|
66 |
st.info(claims)
|
|
|
|
|
|
|
|
|
67 |
|