Skip to content

Instantly share code, notes, and snippets.

View mssfang's full-sized avatar

Shawn Fang mssfang

  • Microsoft
  • Redmond
  • 08:09 (UTC -12:00)
View GitHub Profile
@mssfang
mssfang / Text Analytics for Java API Design - First Draft.md
Last active November 24, 2019 17:35
Text Analytic Preview 1 APIs for Java (Draft)

TextAnalytics

TextAnalyticsClientBuilder

`public final class TextAnalyticsClientBuilder {

    public TextAnalyticsClientBuilder() {}

    public TextAnalyticsClient buildClient() {}

    public TextAnalyticsAsyncClient buildAsyncClient() {}
@mssfang
mssfang / opinionMiningSamples.md
Last active August 12, 2020 06:15
Samples for Opinion Mining

(1) Exmaple for atomic single string input,

(1.1) Sync Version

String document = "Bad atmosphere. Not close to plenty of restaurants, hotels, and transit! Staff are not friendly and helpful.";

System.out.printf("Text = %s%n", document);

AnalyzeSentimentOptions options = new AnalyzeSentimentOptions().setIncludeOpinionMining(true);
final DocumentSentiment documentSentiment = client.analyzeSentiment(document, "en", options);

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:

{ 
  "displayName": "Custom Text Jobs", 

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": [