Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -112,17 +112,17 @@ def anonymize_fn(original_text):
|
|
112 |
return "", {}, f"Validation error: {str(e)}"
|
113 |
|
114 |
anonymized, entities = anonymize_text(user_text)
|
115 |
-
return anonymized, entities, "
|
116 |
|
117 |
|
118 |
def deanonymize_fn(anonymized_llm_response, entity_map):
|
119 |
if not anonymized_llm_response.strip():
|
120 |
-
return "", "
|
121 |
if not entity_map:
|
122 |
return "", "No entity map found; anonymize some text first."
|
123 |
|
124 |
result = deanonymize_text(anonymized_llm_response, entity_map)
|
125 |
-
return result, "
|
126 |
|
127 |
|
128 |
md_text = """# Анонимизатор психотерапевтических сессий
|
@@ -157,7 +157,7 @@ with gr.Blocks() as demo:
|
|
157 |
|
158 |
with gr.Column():
|
159 |
anonymized_llm_response = gr.Textbox(
|
160 |
-
lines=6, label="Анонимизированная сессия (вставить)
|
161 |
)
|
162 |
deanonymized_text = gr.Textbox(
|
163 |
lines=6, label="Де-анонимизированная сессия", interactive=False
|
|
|
112 |
return "", {}, f"Validation error: {str(e)}"
|
113 |
|
114 |
anonymized, entities = anonymize_text(user_text)
|
115 |
+
return anonymized, entities, "Успешно анонимизировано!"
|
116 |
|
117 |
|
118 |
def deanonymize_fn(anonymized_llm_response, entity_map):
|
119 |
if not anonymized_llm_response.strip():
|
120 |
+
return "", "Вставьте анонимизированный текст."
|
121 |
if not entity_map:
|
122 |
return "", "No entity map found; anonymize some text first."
|
123 |
|
124 |
result = deanonymize_text(anonymized_llm_response, entity_map)
|
125 |
+
return result, "Успешно деанонимизировано!"
|
126 |
|
127 |
|
128 |
md_text = """# Анонимизатор психотерапевтических сессий
|
|
|
157 |
|
158 |
with gr.Column():
|
159 |
anonymized_llm_response = gr.Textbox(
|
160 |
+
lines=6, label="Анонимизированная сессия (вставить)"
|
161 |
)
|
162 |
deanonymized_text = gr.Textbox(
|
163 |
lines=6, label="Де-анонимизированная сессия", interactive=False
|