mrsk1883 commited on
Commit
e9d4bd7
1 Parent(s): 6416b3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -31,15 +31,12 @@ def extract_abstract_and_summarize(pdf_file):
31
  abstract_text = text[start_index:end_index]
32
  break
33
 
34
- # Summarize the extracted abstract using the LED-large model
35
- result = summarizer(abstract_text)
36
 
37
- # Print the entire result for debugging
38
- print("Result:", result)
39
-
40
- # Check if 'summary' is present in the result
41
  if result and isinstance(result, list) and len(result) > 0:
42
- summary = result[0].get('summary', 'Summary not available.')
43
  else:
44
  summary = "Summary not available."
45
 
 
31
  abstract_text = text[start_index:end_index]
32
  break
33
 
34
+ # Summarize the extracted abstract using the LED-large model with a specific max_length
35
+ result = summarizer(abstract_text, max_length=81)
36
 
37
+ # Check if 'summary_text' is present in the result
 
 
 
38
  if result and isinstance(result, list) and len(result) > 0:
39
+ summary = result[0].get('summary_text', 'Summary not available.')
40
  else:
41
  summary = "Summary not available."
42