update file code
Browse files- FZY3JW.cw127.pkl +0 -0
- FZY3JW.pkl +0 -0
- __pycache__/textInput.cpython-39.pyc +0 -0
- app.py +1 -1
- temp.docx +0 -0
- textInput.py +10 -8
FZY3JW.cw127.pkl
ADDED
Binary file (518 Bytes). View file
|
|
FZY3JW.pkl
ADDED
Binary file (140 kB). View file
|
|
__pycache__/textInput.cpython-39.pyc
CHANGED
Binary files a/__pycache__/textInput.cpython-39.pyc and b/__pycache__/textInput.cpython-39.pyc differ
|
|
app.py
CHANGED
@@ -43,4 +43,4 @@ with gr.Blocks(css = ".output {min-height: 500px}") as demo:
|
|
43 |
text_button.click(textInput.text_dump_to_lines, inputs=[text_input,topic_num,max_length], outputs=[text_keys_output,text_ab_output,file_txt_output,file_docx_output,file_pdf_output])
|
44 |
file_button.click(textInput.file_dump_to_lines,inputs=[file_input,topic_num,max_length], outputs=[text_keys_output,text_ab_output,file_txt_output,file_docx_output,file_pdf_output])
|
45 |
|
46 |
-
demo.launch()
|
|
|
43 |
text_button.click(textInput.text_dump_to_lines, inputs=[text_input,topic_num,max_length], outputs=[text_keys_output,text_ab_output,file_txt_output,file_docx_output,file_pdf_output])
|
44 |
file_button.click(textInput.file_dump_to_lines,inputs=[file_input,topic_num,max_length], outputs=[text_keys_output,text_ab_output,file_txt_output,file_docx_output,file_pdf_output])
|
45 |
|
46 |
+
demo.launch(show_api=False, enable_queue=False)
|
temp.docx
DELETED
Binary file (40.6 kB)
|
|
textInput.py
CHANGED
@@ -39,14 +39,16 @@ def file_dump_to_lines(file,topic_num,max_length):
|
|
39 |
pageText = page.get_text("text")
|
40 |
lines.extend([x.strip() for x in pageText.split("\n") if x.strip()!=''])
|
41 |
# print(lines)
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
#
|
48 |
-
#
|
49 |
-
|
|
|
|
|
50 |
|
51 |
def dump_to_txt(lines):
|
52 |
text = "\n".join(lines)
|
|
|
39 |
pageText = page.get_text("text")
|
40 |
lines.extend([x.strip() for x in pageText.split("\n") if x.strip()!=''])
|
41 |
# print(lines)
|
42 |
+
text = "\n".join(lines)
|
43 |
+
print(text)
|
44 |
+
keysText, outputText, txt_path, docx_path, pdf_path = text_dump_to_lines(text,topic_num,max_length)
|
45 |
+
# sentences = run.texClear(lines)
|
46 |
+
# keys, output = run.textToAb(sentences,lines,int(topic_num),int(max_length))
|
47 |
+
# keysText = "\n".join(keys)
|
48 |
+
# outputText = "\n".join(output)
|
49 |
+
# # text = "\n".join(lines)
|
50 |
+
# # return text, text, dump_to_txt(lines), dump_to_docx(lines), dump_to_pdf(lines)
|
51 |
+
return keysText, outputText, txt_path, docx_path, pdf_path
|
52 |
|
53 |
def dump_to_txt(lines):
|
54 |
text = "\n".join(lines)
|