Spaces:
Sleeping
Sleeping
Commit
·
dc5c795
1
Parent(s):
6038ff0
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,6 +30,13 @@ def sample_analyze_entities(text_content, your_query=""):
|
|
| 30 |
)
|
| 31 |
client = language_v1.LanguageServiceClient(credentials=credentials)
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
# ... (rest of your NLP code)
|
| 34 |
entities_list = []
|
| 35 |
for entity in response.entities:
|
|
|
|
| 30 |
)
|
| 31 |
client = language_v1.LanguageServiceClient(credentials=credentials)
|
| 32 |
|
| 33 |
+
type_ = language_v1.Document.Type.PLAIN_TEXT
|
| 34 |
+
language = "en"
|
| 35 |
+
document = {"content": text_content, "type_": type_, "language": language}
|
| 36 |
+
encoding_type = language_v1.EncodingType.UTF8
|
| 37 |
+
response = client.analyze_entities(request={"document": document, "encoding_type": encoding_type})
|
| 38 |
+
|
| 39 |
+
|
| 40 |
# ... (rest of your NLP code)
|
| 41 |
entities_list = []
|
| 42 |
for entity in response.entities:
|