Page tree
Skip to end of metadata
Go to start of metadata

The org.opencode4workspace.endpoints.FocusPostEndpoint is used to post text for Focus analysis and retrieve a List of Focus objects corresponding to the analyses.

The FocusEndpoint is instantiated, like the other endpoints, by passing in the WWClient for the request. The text string is posted using the postMessage(String text) method. Alternatively, the WWClient.postTextForFocusAnalysis(String text) helper method is available for easier use.

A List of Focus objects is returned. The applicationId and lensId are auto-generated. The focusVersion is defined by Watson Work Services. The lens identifies what was identified - an "ActionRequest", a "Question" or a "Commitment". The confidence is a number between 0 and 1 that identifies how certain Watson Work Services was in identifying the lens. The start and end are the indices of within the passed text that the phrase can be found. It seems that the lens always hashidden set to true.

postTextForFocus
@Test(enabled = true)
@Parameters({ "appId", "appSecret" })
public void postTestForFocus(String appId, String appSecret) throws UnsupportedEncodingException, WWException {
    String TEXT = "Hello, I think we need to reconsider. Let's add a meeting on Tuesday 13th March. Frank, what do you think?";
    WWClient client = WWClient.buildClientApplicationAccess(appId, appSecret, new WWAuthenticationEndpoint());
    assert !client.isAuthenticated();
    client.authenticate();
    assert client.isAuthenticated();

    List<Focus> focuses = client.postTextForFocusAnalysis(TEXT);
    assert (focuses.size() == 3);
    assert (focuses.get(0).getLens().equals(Lens.ACTION_REQUEST));
    assert (focuses.get(2).getLens().equals(Lens.QUESTION));
    assert (38 == focuses.get(0).getEnd());
    assert (1.0 == focuses.get(1).getConfidence());
}

2 Comments

  1. Anonymous

    Pretest scores for the both group will disclose to us whether the two gatherings began in a similar place. In the event that the coaching was successful, the circulation of the post-test scores from write my dissertation the gathering that got mentoring ought to be higher than the post-test scores.

  2. Anonymous

    It is essential to increase one's information and comprehend some points of view, trial, specifics, and substantiation, or reassess already known things. In numerous instances, to investigate seriously, we require to relate critical thoughts skills, and the major secret of successful conclusion of the assignment you are certain is the capability to read between the lines, best dissertation writing services observes through the text to recognize author's ideas, thoughts, and purposes, secreted in the handy-dandy plan and story.

Write a comment…