owaiskha9654 commited on
Commit
e1a934e
β€’
1 Parent(s): 07a2c4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -16,6 +16,7 @@ def Multi_Label_Classification_of_Pubmed_Articles(model_input: str) -> Dict[str,
16
 
17
  # tokenized = tokenizer.tokenize_and_pad(model_input)
18
  # Encoding input data
 
19
  Articles_test = list(model_input)
20
  test_encodings = tokenizer.batch_encode_plus(Articles_test,max_length=max_length,padding=True,truncation=True)
21
  test_input_ids = test_encodings['input_ids']
@@ -63,12 +64,12 @@ def Multi_Label_Classification_of_Pubmed_Articles(model_input: str) -> Dict[str,
63
  true_bools = [tl==1 for tl in true_labels]
64
 
65
 
66
- prediction = model.predict(tokenized)[0]
67
- ret = {
68
- "negative": float(prediction[0]),
69
- "positive": float(prediction[1])
70
- }
71
- return ret
72
 
73
 
74
  model_input = gr.Textbox("Input text here", show_label=False)
 
16
 
17
  # tokenized = tokenizer.tokenize_and_pad(model_input)
18
  # Encoding input data
19
+ max_length = 128
20
  Articles_test = list(model_input)
21
  test_encodings = tokenizer.batch_encode_plus(Articles_test,max_length=max_length,padding=True,truncation=True)
22
  test_input_ids = test_encodings['input_ids']
 
64
  true_bools = [tl==1 for tl in true_labels]
65
 
66
 
67
+ #prediction = model.predict(tokenized)[0]
68
+ #ret = {
69
+ # "negative": float(prediction[0]),
70
+ # "positive": float(prediction[1])
71
+ #}
72
+ return true_bools
73
 
74
 
75
  model_input = gr.Textbox("Input text here", show_label=False)