Skip to content

Instantly share code, notes, and snippets.

@mssfang
Last active July 8, 2021 06:09
Show Gist options
  • Save mssfang/da4582895af9b8224d91029b2ee9b992 to your computer and use it in GitHub Desktop.
Save mssfang/da4582895af9b8224d91029b2ee9b992 to your computer and use it in GitHub Desktop.

API

PollerFlux<AnalyzeActionsOperationDetail, AnalyzeActionsResultPagedFlux> beginAnalyzeActions(Iterable<TextDocumentInput> documents, TextAnalyticsActions actions, AnalyzeActionsOptions options) 
SyncPoller<AnalyzeActionsOperationDetail, AnalyzeActionsResultPagedIterable> beginAnalyzeActions(Iterable<TextDocumentInput> documents, TextAnalyticsActions actions, AnalyzeActionsOptions options, Context context) 

Example:

"analysisInput": {
   "documents": [
   {
     "id": "1",
     "text": "The government of British Prime Minster Theresa May has been plunged into tu
       rmoil with the resignation of two senior Cabinet ministers in a deep split over her Brexit st
       rategy. The Foreign Secretary Boris Johnson, quit on Monday, hours after the resignation lat
       e on Sunday night of the minister in charge of Brexit negotiations, David Davis. Their decis
       ion to leave the government came three days after May appeared to have agreed a deal with her
       fractured Cabinet on the UK's post�Brexit relationship with the EU. That plan is now in tatters and her political future appear
       s uncertain. May appeared in Parliament on Monday afternoon to defend her plan, minutes afte
       r Downing Street confirmed the departure of Johnson. May acknowledged the splits in her stat
       ement to MPs, saying of the ministers who quit: \"We do not agree about the best way of deliv
       ering our shared commitment to honoring the result of the referendum.\" The Prime Minister's
       latest plitical drama began late on Sunday night when Davis quit, declaring he could not sup
       port May's Brexit plan. He said it involved too close a relationship with the EU and gave on
       ly an illusion of control being returned to the UK after it left the EU. \"It seems to me we
       're giving too much away, too easily, and that's a dangerous strategy at this time,\" Davis s
       aid in a BBC radio interview Monday morning. Johnson's resignation came Monday afternoon loc
       al time, just before the Prime Minister was due to make a scheduled statement in Parliament. 
       \"This afternoon, the Prime Minister accepted the resignation of Boris Johnson as Foreign Sec
       retary,\" a statement from Downing Street said."
    }]
 },
 "tasks": {
   "extractiveSummarizationTasks": [
   {
     "model-version": "latest",
     "stringIndexType": "UnicodeCodePoint",
     "sentenceCount": 3
   }]
 }
}
  
{
   "displayName": "Extractive Summarization Job",
   "jobId": "49e8b199-2a07-40e3-9207-cc16f6917909",
   "lastUpdateDateTime": "2021-03-18T20:11:01Z",
   "createdDateTime": "2021-03-18T20:10:57Z",
   "expirationDateTime": "2021-03-19T20:10:57Z",
   "status": "succeeded",
   "errors": [],
   "tasks": {
   "details": {
      "name": "Extractive Summarization Job",
      "lastUpdateDateTime": "2021-03-18T20:11:01Z"
   },
   "completed": 1,
   "failed": 0,
   "inProgress": 0,
   "total": 1,
   "extractiveSummarizationTasks": [
     {
        "lastUpdateDateTime": "2021-03-18T20:11:01.2235829Z",
        "name": "Extractive Summarization Job",
        "state": "succeeded",
        "results": {
        "documents": [
          {
             "id": "1",
             "sentences": [
              {
                "text": " The Foreign Secretary Boris Johnson, quit on Monday, hours after the resignation late on Sunday night of the minister in charge of Brexit negotiations, David Davis."
                "offset": "178",
                "length": "164",
                "rankScore": -0.58
              },
             {
                "text": " May appeared in Parliament on Monday afternoon to defend her plan, minutes after Downing Street confirmed the departure of Johnson.",
                 "offset": "591",
                 "length": "131",
                 "rankScore": -0.68
             },
             {
               "text": " \\"This afternoon, the Prime Minister accepted the resignation of Boris Johnson as Foreign Secretary,\\" a statement from Downing Street said.",
               "offset": "1508",
               "length": "140",
               "rankScore": -0.68
             }
          ],
         "warnings": []
       }
     ],
     "errors": [],
     "modelVersion": "TBD"
     }
   }
 ]
}
}

Extract Summarization Action

APIView: https://apiview.dev/Assemblies/Review/f62ee261035a44189c597868c7a8a7ee?diffRevisionId=e29160855fe14bfb97045ae5c2220c70&doc=False&diffOnly=True

Sample: https://github.com/Azure/azure-sdk-for-java/blob/0f67d01b0635564af8bd84bd041cf20fef816b3b/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/lro/AnalyzeSummarizedSentencesAction.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment