Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import spacy
|
3 |
import re
|
|
|
4 |
|
5 |
# Load the spaCy model, confirm that additional download has been made
|
6 |
nlp = spacy.load("en_core_web_sm")
|
@@ -61,11 +62,15 @@ def anonymize_text_including_proper_nouns_and_addresses(text):
|
|
61 |
|
62 |
return anonymized_text
|
63 |
|
64 |
-
|
|
|
|
|
|
|
65 |
demo = gr.Interface(
|
66 |
fn=anonymize_text_including_proper_nouns_and_addresses,
|
67 |
inputs=["text"],
|
68 |
outputs=["text"],
|
|
|
69 |
)
|
70 |
|
71 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import spacy
|
3 |
import re
|
4 |
+
from collections import Counter
|
5 |
|
6 |
# Load the spaCy model, confirm that additional download has been made
|
7 |
nlp = spacy.load("en_core_web_sm")
|
|
|
62 |
|
63 |
return anonymized_text
|
64 |
|
65 |
+
dummy_text = """
|
66 |
+
Contact John Doe at 123-456-7890, visit example.com or [email protected].
|
67 |
+
My SSN is 123-45-6789. Meet me at 123 Gary Crant, in Casablanca
|
68 |
+
"""
|
69 |
demo = gr.Interface(
|
70 |
fn=anonymize_text_including_proper_nouns_and_addresses,
|
71 |
inputs=["text"],
|
72 |
outputs=["text"],
|
73 |
+
examples=[[dummy_text]]
|
74 |
)
|
75 |
|
76 |
demo.launch()
|