davidmezzetti commited on
Commit
e43b653
1 Parent(s): 09a5aa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -15
app.py CHANGED
@@ -13,7 +13,7 @@ import pandas as pd
13
  import streamlit as st
14
 
15
  from txtai.embeddings import Documents, Embeddings
16
- from txtai.pipeline import Segmentation, Summary, Tabular, Textractor, Transcription, Translation
17
  from txtai.workflow import ServiceTask, Task, UrlTask, Workflow
18
 
19
 
@@ -94,11 +94,8 @@ class Application:
94
  options["minlength"] = self.number("Min length")
95
  options["maxlength"] = self.number("Max length")
96
 
97
- elif component in ("segment", "textract"):
98
- if component == "segment":
99
- st.sidebar.markdown("**Segment** \n*Split text into semantic units*")
100
- else:
101
- st.sidebar.markdown("**Textractor** \n*Extract text from documents*")
102
 
103
  options["sentences"] = st.sidebar.checkbox("Split sentences")
104
  options["lines"] = st.sidebar.checkbox("Split lines")
@@ -172,10 +169,6 @@ class Application:
172
  self.pipelines[wtype] = Tabular(**self.components["tabular"])
173
  tasks.append(Task(self.pipelines["tabular"]))
174
 
175
- elif wtype == "textract":
176
- self.pipelines[wtype] = Textractor(**self.components["textract"])
177
- tasks.append(UrlTask(self.pipelines["textract"]))
178
-
179
  elif wtype == "transcribe":
180
  self.pipelines[wtype] = Transcription(component.pop("path"))
181
  tasks.append(UrlTask(self.pipelines["transcribe"], r".\.wav$"))
@@ -223,10 +216,6 @@ class Application:
223
  data["tabular"] = component
224
  tasks.append({"action": "tabular"})
225
 
226
- elif wtype == "textract":
227
- data["textractor"] = component
228
- tasks.append({"action": "textractor", "task": "url"})
229
-
230
  elif wtype == "transcribe":
231
  data["transcription"] = {"path": component.pop("path")}
232
  tasks.append({"action": "transcription", "task": "url"})
@@ -341,7 +330,7 @@ class Application:
341
  st.sidebar.markdown("# Workflow builder \n*Build and apply workflows to data* ")
342
 
343
  # Get selected components
344
- components = ["embeddings", "segment", "service", "summary", "tabular", "textract", "transcribe", "translate"]
345
  selected = st.sidebar.multiselect("Select components", components)
346
 
347
  # Get selected options
 
13
  import streamlit as st
14
 
15
  from txtai.embeddings import Documents, Embeddings
16
+ from txtai.pipeline import Segmentation, Summary, Tabular, Transcription, Translation
17
  from txtai.workflow import ServiceTask, Task, UrlTask, Workflow
18
 
19
 
 
94
  options["minlength"] = self.number("Min length")
95
  options["maxlength"] = self.number("Max length")
96
 
97
+ elif component == "segment:"
98
+ st.sidebar.markdown("**Segment** \n*Split text into semantic units*")
 
 
 
99
 
100
  options["sentences"] = st.sidebar.checkbox("Split sentences")
101
  options["lines"] = st.sidebar.checkbox("Split lines")
 
169
  self.pipelines[wtype] = Tabular(**self.components["tabular"])
170
  tasks.append(Task(self.pipelines["tabular"]))
171
 
 
 
 
 
172
  elif wtype == "transcribe":
173
  self.pipelines[wtype] = Transcription(component.pop("path"))
174
  tasks.append(UrlTask(self.pipelines["transcribe"], r".\.wav$"))
 
216
  data["tabular"] = component
217
  tasks.append({"action": "tabular"})
218
 
 
 
 
 
219
  elif wtype == "transcribe":
220
  data["transcription"] = {"path": component.pop("path")}
221
  tasks.append({"action": "transcription", "task": "url"})
 
330
  st.sidebar.markdown("# Workflow builder \n*Build and apply workflows to data* ")
331
 
332
  # Get selected components
333
+ components = ["embeddings", "segment", "service", "summary", "tabular", "transcribe", "translate"]
334
  selected = st.sidebar.multiselect("Select components", components)
335
 
336
  # Get selected options