Spaces:
Runtime error
Runtime error
panotedi
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -81,10 +81,10 @@ def training_computation(_dataset_dict):
|
|
81 |
training_args = TFTrainingArguments(
|
82 |
output_dir='./results',
|
83 |
num_train_epochs=2,
|
84 |
-
per_device_train_batch_size=
|
85 |
-
per_device_eval_batch_size=
|
86 |
-
warmup_steps=
|
87 |
-
eval_steps=
|
88 |
weight_decay=0.01
|
89 |
)
|
90 |
|
@@ -115,3 +115,15 @@ patent_selection = st.selectbox("Select Patent",patents['patent_number'])
|
|
115 |
patent = patents.loc[patents['patent_number'] == patent_selection]
|
116 |
st.write(patent['abstract'])
|
117 |
st.write(patent['claims'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
training_args = TFTrainingArguments(
|
82 |
output_dir='./results',
|
83 |
num_train_epochs=2,
|
84 |
+
per_device_train_batch_size=128,
|
85 |
+
per_device_eval_batch_size=256,
|
86 |
+
warmup_steps=5,
|
87 |
+
eval_steps=5,
|
88 |
weight_decay=0.01
|
89 |
)
|
90 |
|
|
|
115 |
patent = patents.loc[patents['patent_number'] == patent_selection]
|
116 |
st.write(patent['abstract'])
|
117 |
st.write(patent['claims'])
|
118 |
+
|
119 |
+
submitted = st.form_submit_button("Submit")
|
120 |
+
|
121 |
+
if submitted:
|
122 |
+
pat_abstract = patent['abstract'].tolist()
|
123 |
+
#pat_score = patent['patentability_score'].tolist()
|
124 |
+
test_encodings = tokenizer(pat_abstract, truncation=True, padding=True)
|
125 |
+
test_dataset = tf.data.Dataset.from_tensor_slices((
|
126 |
+
dict(test_encodings)
|
127 |
+
))
|
128 |
+
predictions = trainer.predict(test_dataset)[1]
|
129 |
+
st.write(predictions)
|