[text analytics] add sample stories and improve documents#15429
[text analytics] add sample stories and improve documents#15429iscai-msft merged 11 commits intoAzure:masterfrom
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.
nit: the """ """ type string adds newlines to output
There was a problem hiding this comment.
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 |
...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
| {"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.
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.
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!") |
| """ | ||
| 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.
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.
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.
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.
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.
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
…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) ...
fixes #14509