Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,8 +23,12 @@ def get_pdf_text(pdf_docs : list) -> str:
|
|
23 |
for page in pdf_reader.pages:
|
24 |
text += page.extract_text()
|
25 |
return text
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
def get_text_chunks(text:str) ->list:
|
29 |
text_splitter = CharacterTextSplitter(
|
30 |
separator="\n", chunk_size=1500, chunk_overlap=300, length_function=len
|
|
|
23 |
for page in pdf_reader.pages:
|
24 |
text += page.extract_text()
|
25 |
return text
|
26 |
+
###########################################
|
27 |
+
def load_file():
|
28 |
+
loader = TextLoader('d2.txt')
|
29 |
+
documents = loader.load()
|
30 |
+
return documents
|
31 |
+
######################################
|
32 |
def get_text_chunks(text:str) ->list:
|
33 |
text_splitter = CharacterTextSplitter(
|
34 |
separator="\n", chunk_size=1500, chunk_overlap=300, length_function=len
|