wfranco commited on
Commit
bc49441
·
1 Parent(s): a1e0a35

Create requirements.txt

Browse files
Files changed (1) hide show
  1. requirements.txt +36 -0
requirements.txt ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !pip install PyPDF2
2
+
3
+ #PyPDF2: To read the PDF file from the repository path.
4
+ !pip install pdfminer.six
5
+ !pip install pdfplumber
6
+ !pip install pdf2image
7
+ !pip install Pillow
8
+ !pip install pytesseract
9
+
10
+ #Other libraries
11
+ !apt-get install poppler-utils
12
+ !apt install tesseract-ocr
13
+ !apt install libtesseract-dev
14
+
15
+ # To read the PDF
16
+ import PyPDF2
17
+ from pdfminer.high_level import extract_pages, extract_text
18
+ from pdfminer.layout import LTTextContainer, LTChar, LTRect, LTFigure
19
+ import pdfplumber
20
+ from PIL import Image
21
+ from pdf2image import convert_from_path
22
+ import pytesseract
23
+ import os
24
+
25
+ ! pip install transformers
26
+ from transformers import pipeline
27
+ import torch
28
+ from transformers import pipeline
29
+
30
+ hf_name = 'pszemraj/led-large-book-summary'
31
+
32
+ summarizer = pipeline(
33
+ "summarization",
34
+ hf_name,
35
+ device=0 if torch.cuda.is_available() else -1,
36
+ )