-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[text analytics] add sample stories and improve documents #15429
Conversation
…into sample_documents * 'master' of https://github.com/Azure/azure-sdk-for-python: (225 commits) [text analtyics] add abby as codeowner (Azure#15376) test (Azure#15402) fix iothub version (Azure#15405) [T2] Batch (Azure#14757) [T2] Policyinsights (Azure#14794) [T2] apimanagement Wave3 (Azure#14804) [T2] devtestlabs Wave3 (Azure#14795) [T2]eventgrid wave3 (Azure#14805) [T2] Search (Azure#14823) test,version,CHANGELOG (Azure#14838) [T2]datalake-store Wave3 (Azure#14765) [T2] cdn 2020 11 15 (Azure#14952) [T2] security (Azure#14953) [T2] Relay (Azure#14968) [T2] Cognitiveservice (Azure#14977) [T2] advisor (Azure#14995) [T2] Marketplaceordering (Azure#15001) [T2]machinelearningservices wave3 (Azure#14726) test,version,CHANGELOG (Azure#14842) [T2] OperationsManagement (Azure#14950) ...
""" | ||
Microsoft was founded by Bill Gates and Paul Allen. Its headquarters are located in Redmond. Redmond is a | ||
city in King County, Washington, United States, located 15 miles east of Seattle. | ||
""", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the """ """ type string adds newlines to output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry. I added that to make it more clear this is a document visually. There are no print statements though, so I'm going to ignore your nit for now
"I need to take my cat to the veterinarian.", | ||
"I will travel to South America in the summer." | ||
""" | ||
I need to take my cat to the veterinarian. He has been sick recently, and I need to take him |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so sorry
...textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_sentiment_async.py
Outdated
Show resolved
Hide resolved
...ai-textanalytics/samples/async_samples/sample_analyze_sentiment_with_opinion_mining_async.py
Outdated
Show resolved
Hide resolved
sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_detect_language_async.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
{"id": "0", "language": "en", "text": "I had the best day of my life."}, | ||
{"id": "1", "language": "en", | ||
{"id": "0", "country_hint": "US", "text": "I had the best day of my life. I decided to go sky-diving and it made me appreciate my whole life so much more. I developed a deep-connection with my instructor as well."}, | ||
{"id": "1", "country_hint": "GB", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, why in some cases the whole object is in one line, and in some it is divided? I can't find the pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For dicts idk if it would work to have it on multiple lines, I'm not sure how it would render. Otherwise, I try to make it as document-like as possible. In cases where I have to print the document, I can't make it as document-like as possible, since that format introduces whitespace that looks weird when printed
if not any_sentence_not_positive: | ||
positive_reviews_final.append(review) | ||
|
||
print("We now have the final list of positive reviews we are going to display on our website!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, great imagination :)
""" | ||
The food and service were unacceptable, but the concierge were nice. | ||
After talking to them about the quality of the food and the process to get room service they refunded | ||
the money we spent at the restaurant and gave us a voucher for near by restaurants. | ||
""", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the format in this sample as it is clear where each document starts and ends. Could you apply it in other places i.e. recognize_entities_azync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having it like this introduces whitespace that looks weird printed, so I only have it like this in samples where the documents themselves won't be printed
print( | ||
"In this sample we own a hotel with customers from all around the globe. We want to eventually " | ||
"translate these reviews into English so our manager can read them. However, we first need to know which language " | ||
"they are in for more accurate translation. This is the step we will be covering in this sample\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it is worth saying something like
Note: translation is not covered in this sample
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok, since detect_language
just detects language, so I don't think users would expect the sample to do translation. I also mention that this sample only covers detecting a language
walking up the stairs :). Can't say enough good things about my experience! | ||
""", | ||
""" | ||
最近由于工作压力太大,我们决定去富酒店度假。那儿的温泉实在太舒服了,我跟我丈夫都完全恢复了工作前的青春精神!加油! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, what it says :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a lot of pressure at work recently, so I've decided to go to Foo Hotel (I went with a chinese character that sounded like Foo, and means wealth) for a holiday. Their spa is so comfortable, my husband and I both recovered our pre-work energy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the ideas!!!
…into feature/textanalytics5.2 * 'master' of https://github.com/Azure/azure-sdk-for-python: (40 commits) Sync eng/common directory with azure-sdk-tools for PR 1203 (#15441) [ServiceBus] Graceful noops for methods taking empty lists. (#15286) [text analytics] add sample stories and improve documents (#15429) [ServiceBus] Enable FQDNs and connection strings to support newlines and protocol prefixing (e.g. sb://) (#15212) Fix combined session+auto-auto_lock_renewer+receive-and-delete mode issue where registry would fail during receipt. Add tests and changelog entry. (#15343) Add Update-python-CIConfig (#15379) Remove aiodns from our CI (#15424) Resolve Broken Portal Link (#15431) [Key Vault] Update tests which disable soft-delete (#15352) switching order on readme (#15426) [text analtyics] add abby as codeowner (#15376) test (#15402) fix iothub version (#15405) [T2] Batch (#14757) [T2] Policyinsights (#14794) [T2] apimanagement Wave3 (#14804) [T2] devtestlabs Wave3 (#14795) [T2]eventgrid wave3 (#14805) [T2] Search (#14823) test,version,CHANGELOG (#14838) ...
[Hub Generated] Review request for description changes under maps/data-plane/Route & Search (Azure#15429) * Merge changes in PR:14813 * Merge changes in PR:14829 * Merge changes in PR:14965 Co-authored-by: Alan Yang <[email protected]>
[Hub Generated] Review request for description changes under maps/data-plane/Route & Search (Azure#15429) * Merge changes in PR:14813 * Merge changes in PR:14829 * Merge changes in PR:14965 Co-authored-by: Alan Yang <[email protected]>
[Hub Generated] Review request for description changes under maps/data-plane/Route & Search (Azure#15429) * Merge changes in PR:14813 * Merge changes in PR:14829 * Merge changes in PR:14965 Co-authored-by: Alan Yang <[email protected]>
[Hub Generated] Review request for description changes under maps/data-plane/Route & Search (Azure#15429) * Merge changes in PR:14813 * Merge changes in PR:14829 * Merge changes in PR:14965 Co-authored-by: Alan Yang <[email protected]>
fixes #14509