Skip to content

Commit 15bdedc

Browse files
committed
updated readme, changelog
1 parent de27fb3 commit 15bdedc

File tree

3 files changed

+97
-3
lines changed

3 files changed

+97
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Change Log
22
==========
3+
## Version 0.14.0
4+
_2017-07-xx_
5+
* New: Abstracted `Natural Language Understanding` service.
6+
37
## Version 0.13.0
48
_2017-01-25_
59

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Use this SDK to build Watson-powered applications in Unity. It comes with a set
2424
* [AlchemyData News](#alchemy-data-news)
2525
* [Retrieve and Rank](#retrieve-and-rank)
2626
* [Discovery](#discovery)
27+
* [Natural Language Understanding](#natural-language-understanding)
2728
* [Developing a basic application in one minute](#developing-a-basic-application-in-one-minute)
2829
* [Documentation](#documentation)
2930
* [License](#license)
@@ -2814,6 +2815,94 @@ private void OnQuery(QueryResponse resp, string data)
28142815
Log.Debug("ExampleDiscoveryV1", "resp is null, {0}", data);
28152816
}
28162817
```
2818+
### Natural Language Understanding
2819+
[Natural Language Understanding][natural_language_understanding] uses natural language processing to analyze semantic features of any text. Provide plain text, HTML, or a public URL, and Natural Language Understanding returns results for the features you specify. The service cleans HTML before analysis by default, which removes most advertisements and other unwanted content.
2820+
2821+
You can create [custom models][nlu_models] with Watson Knowledge Studio that can be used to detect custom [entities][nlu_entities] and [relations][nlu_relations] in Natural Language Understanding.
2822+
2823+
#### Analyze
2824+
Analyze features of natural language content.
2825+
2826+
```cs
2827+
NaturalLanguageUnderstanding m_NaturalLanguageUnderstanding = new NaturalLanguageUnderstanding();
2828+
private static fsSerializer sm_Serializer = new fsSerializer();
2829+
2830+
void Start ()
2831+
{
2832+
Parameters parameters = new Parameters()
2833+
{
2834+
text = <text-to-analyze>,
2835+
return_analyzed_text = true,
2836+
language = "en",
2837+
features = new Features()
2838+
{
2839+
entities = new EntitiesOptions()
2840+
{
2841+
limit = 50,
2842+
sentiment = true,
2843+
emotion = true,
2844+
},
2845+
keywords = new KeywordsOptions()
2846+
{
2847+
limit = 50,
2848+
sentiment = true,
2849+
emotion = true
2850+
}
2851+
}
2852+
};
2853+
2854+
if (!m_NaturalLanguageUnderstanding.Analyze(OnAnalyze, parameters))
2855+
Log.Debug("ExampleNaturalLanguageUnderstandingV1", "Failed to get models.");
2856+
}
2857+
2858+
private void OnAnalyze(AnalysisResults resp, string customData)
2859+
{
2860+
fsData data = null;
2861+
sm_Serializer.TrySerialize(resp, out data).AssertSuccess();
2862+
Log.Debug("ExampleNaturalLanguageUnderstandingV1", "AnalysisResults: {0}", data.ToString());
2863+
}
2864+
```
2865+
2866+
#### Get models
2867+
List available custom models.
2868+
2869+
```cs
2870+
NaturalLanguageUnderstanding m_NaturalLanguageUnderstanding = new NaturalLanguageUnderstanding();
2871+
private static fsSerializer sm_Serializer = new fsSerializer();
2872+
2873+
void Start ()
2874+
{
2875+
if (!m_NaturalLanguageUnderstanding.GetModels(OnGetModels))
2876+
Log.Debug("ExampleNaturalLanguageUnderstandingV1", "Failed to get models.");
2877+
}
2878+
2879+
private void OnGetModels(ListModelsResults resp, string customData)
2880+
{
2881+
fsData data = null;
2882+
sm_Serializer.TrySerialize(resp, out data).AssertSuccess();
2883+
Log.Debug("ExampleNaturalLanguageUnderstandingV1", "ListModelsResult: {0}", data.ToString());
2884+
}
2885+
```
2886+
2887+
#### Delete model
2888+
Delete a custom model.
2889+
2890+
```cs
2891+
NaturalLanguageUnderstanding m_NaturalLanguageUnderstanding = new NaturalLanguageUnderstanding();
2892+
private static fsSerializer sm_Serializer = new fsSerializer();
2893+
2894+
void Start ()
2895+
{
2896+
if (!m_NaturalLanguageUnderstanding.DeleteModel(OnDeleteModel, <model-id>))
2897+
Log.Debug("ExampleNaturalLanguageUnderstandingV1", "Failed to delete model.");
2898+
}
2899+
2900+
private void OnDeleteModel(bool success, string customData)
2901+
{
2902+
Log.Debug("ExampleNaturalLanguageUnderstandingV1", "DeleteModelResult: {0}", success);
2903+
}
2904+
```
2905+
28172906

28182907
## Developing a basic application in one minute
28192908
You can quickly develop a basic application that uses the Speech to Text service and the Natural Language Classifier service by using the prefabs that come with the SDK. Ensure that you prepare the test data before you complete the the following steps:
@@ -2876,6 +2965,10 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
28762965
[expressive_ssml]: http://www.ibm.com/watson/developercloud/doc/text-to-speech/http.shtml#expressive
28772966
[ssml]: http://www.ibm.com/watson/developercloud/doc/text-to-speech/SSML.shtml
28782967
[discovery-query]: http://www.ibm.com/watson/developercloud/doc/discovery/using.shtml
2968+
[natural_language_understanding]: https://www.ibm.com/watson/developercloud/natural-language-understanding.html
2969+
[nlu_models]: https://www.ibm.com/watson/developercloud/doc/natural-language-understanding/customizing.html
2970+
[nlu_entities]: https://www.ibm.com/watson/developercloud/natural-language-understanding/api/v1/#entities
2971+
[nlu_relations]: https://www.ibm.com/watson/developercloud/natural-language-understanding/api/v1/#relations
28792972

28802973
[dialog_service]: http://www.ibm.com/watson/developercloud/doc/dialog/
28812974
[dialog_migration]: https://www.ibm.com/watson/developercloud/doc/conversation/migration.shtml

Scripts/Services/NaturalLanguageUnderstanding/v1/NaturalLanguageUnderstanding.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
using IBM.Watson.DeveloperCloud.Connection;
2020
using IBM.Watson.DeveloperCloud.Logging;
2121
using IBM.Watson.DeveloperCloud.Utilities;
22-
using MiniJSON;
2322
using System;
24-
using System.Collections.Generic;
2523
using System.Text;
26-
using UnityEngine;
2724

2825
namespace IBM.Watson.DeveloperCloud.Services.NaturalLanguageUnderstanding.v1
2926
{

0 commit comments

Comments
 (0)