Spaces:
Sleeping
Sleeping
Tirath5504
commited on
Commit
•
3326d52
1
Parent(s):
4000d7b
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,14 @@ def which_department(input_text):
|
|
46 |
except Exception as e:
|
47 |
return "Crime branch"
|
48 |
|
49 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
input_text = translate(input_text)
|
52 |
|
@@ -71,7 +78,7 @@ def pipeline(input_text):
|
|
71 |
|
72 |
iface = gr.Interface(
|
73 |
fn = pipeline,
|
74 |
-
inputs = ["text"],
|
75 |
outputs = ["text", "text", "text"]
|
76 |
)
|
77 |
|
|
|
46 |
except Exception as e:
|
47 |
return "Crime branch"
|
48 |
|
49 |
+
def preprocess(desc, questionaire):
|
50 |
+
desc = translate(desc)
|
51 |
+
input_text = f"Description: {desc}, Questionaire: {questionaire}"
|
52 |
+
return input_text
|
53 |
+
|
54 |
+
def pipeline(desc, questionaire):
|
55 |
+
|
56 |
+
input_text = preprocess(desc, questionaire)
|
57 |
|
58 |
input_text = translate(input_text)
|
59 |
|
|
|
78 |
|
79 |
iface = gr.Interface(
|
80 |
fn = pipeline,
|
81 |
+
inputs = ["text", "text"],
|
82 |
outputs = ["text", "text", "text"]
|
83 |
)
|
84 |
|