Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
-
from file_processing import FileProcessorFactory
|
|
|
|
| 4 |
from entity_recognition import process_text
|
| 5 |
from utils import safe_dataframe
|
| 6 |
|
|
@@ -11,7 +12,8 @@ def show_to_UI(file):
|
|
| 11 |
if processor is None:
|
| 12 |
raise ValueError(f"Unsupported file format: {file.name}")
|
| 13 |
|
| 14 |
-
text = processor.extract_text(file.name) # Extract content
|
|
|
|
| 15 |
output = process_text(text) # Perform entity recognition
|
| 16 |
|
| 17 |
metadata = output["metadata"]
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
+
# from file_processing import FileProcessorFactory
|
| 4 |
+
from file_processing import read_file
|
| 5 |
from entity_recognition import process_text
|
| 6 |
from utils import safe_dataframe
|
| 7 |
|
|
|
|
| 12 |
if processor is None:
|
| 13 |
raise ValueError(f"Unsupported file format: {file.name}")
|
| 14 |
|
| 15 |
+
# text = processor.extract_text(file.name) # Extract content
|
| 16 |
+
text = read_file(file.name) # Extract content
|
| 17 |
output = process_text(text) # Perform entity recognition
|
| 18 |
|
| 19 |
metadata = output["metadata"]
|