Skip to content

Commit 9fecb15

Browse files
committed
readme changes
1 parent 06cabec commit 9fecb15

File tree

2 files changed

+140
-3
lines changed

2 files changed

+140
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Change Log
55
_2016-05-28_
66

77
* New: Added Tone Analyzer v3 abstraction
8-
* New: Added Tradeoff Analyzer abstraction
8+
* New: Added Tradeoff Analytics abstraction
99
* New: Added Conversation abstraction
1010
* New: Added Visual Recognition v3 abstraction
1111
* Fix: Creating test project dynamically for Travis CL integration

README.md

Lines changed: 139 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Use this SDK to build Watson-powered applications in Unity. It comes with a set
1414
* [Language Translation](#language-translation)
1515
* [Dialog](#dialog)
1616
* [Natural Language Classifier](#natural-language-classifier)
17+
* [Tone Analyzer](#tone-analyzer)
18+
* [Tradeoff Analytics](#tradeoff-analytics)
19+
* [Conversation](#conversation)
20+
* [Visual Recognition](#visual-recognition)
1721
* [Developing a basic application in one minute](#developing-a-basic-application-in-one-minute)
1822
* [Documentation](#documentation)
1923
* [License](#license)
@@ -210,9 +214,121 @@ You can use the Natural Language Classifier Editor to import and export classifi
210214
2. In the **Name** field, specify a name for the classifier.
211215
3. Click **Create**.
212216

213-
### Conversation
214-
<!-- conversation description here: Change link below -->
217+
### Tone Analyzer
218+
The [Tone Analyzer][tone_analyzer] service detects emotions, social tendencies and writing style from text input.
215219

220+
```
221+
ToneAnalyzer m_ToneAnalyzer = new ToneAnalyzer();
222+
string m_StringToTestTone = "This service enables people to discover and understand, and revise the impact of tone in their content. It uses linguistic analysis to detect and interpret emotional, social, and language cues found in text.";
223+
224+
void Start () {
225+
m_ToneAnalyzer.GetToneAnalyze( OnGetToneAnalyze, m_StringToTestTone, "TEST");
226+
}
227+
228+
private void OnGetToneAnalyze( ToneAnalyzerResponse resp , string data)
229+
{
230+
Debug.Log("Response: " +resp + " - " + data);
231+
}
232+
```
233+
234+
### Tradeoff Analytics
235+
The [Tradeoff Analytics][tradeoff_analytics] service helps people make better decisions when faced with multiple, sometimes conflicting, goals and alternatives.
236+
237+
```
238+
void Start () {
239+
Problem problemToSolve = new Problem();
240+
problemToSolve.subject = "Test Subject";
241+
242+
List<Column> listColumn = new List<Column>();
243+
Column columnPrice = new Column();
244+
columnPrice.description = "Price Column to minimize";
245+
columnPrice.range = new ValueRange();
246+
((ValueRange)columnPrice.range).high = 600;
247+
((ValueRange)columnPrice.range).low = 0;
248+
columnPrice.type = "numeric";
249+
columnPrice.key = "price";
250+
columnPrice.full_name = "Price";
251+
columnPrice.goal = "min";
252+
columnPrice.is_objective = true;
253+
columnPrice.format = "$####0.00";
254+
255+
Column columnWeight = new Column();
256+
columnWeight.description = "Weight Column to minimize";
257+
columnWeight.type = "numeric";
258+
columnWeight.key = "weight";
259+
columnWeight.full_name = "Weight";
260+
columnWeight.goal = "min";
261+
columnWeight.is_objective = true;
262+
columnWeight.format = "####0 g";
263+
264+
Column columnBrandName = new Column();
265+
columnBrandName.description = "All Brand Names";
266+
columnBrandName.type = "categorical";
267+
columnBrandName.key = "brand";
268+
columnBrandName.full_name = "Brand";
269+
columnBrandName.goal = "max";
270+
columnBrandName.is_objective = true;
271+
columnBrandName.preference = new string[]{"Samsung", "Apple", "HTC"};
272+
columnBrandName.range = new CategoricalRange();
273+
((CategoricalRange)columnBrandName.range).keys = new string[]{"Samsung", "Apple", "HTC"};
274+
275+
listColumn.Add(columnPrice);
276+
listColumn.Add(columnWeight);
277+
278+
problemToSolve.columns = listColumn.ToArray();
279+
280+
281+
List<Option> listOption = new List<Option>();
282+
283+
Option option1 = new Option();
284+
option1.key = "1";
285+
option1.name = "Samsung Galaxy S4";
286+
option1.values = new TestDataValue();
287+
(option1.values as TestDataValue).weight = 130;
288+
(option1.values as TestDataValue).brand = "Samsung";
289+
(option1.values as TestDataValue).price = 249;
290+
listOption.Add(option1);
291+
292+
Option option2 = new Option();
293+
option2.key = "2";
294+
option2.name = "Apple iPhone 5";
295+
option2.values = new TestDataValue();
296+
(option2.values as TestDataValue).weight = 112;
297+
(option2.values as TestDataValue).brand = "Apple";
298+
(option2.values as TestDataValue).price = 599;
299+
listOption.Add(option2);
300+
301+
Option option3 = new Option();
302+
option3.key = "3";
303+
option3.name = "HTC One";
304+
option3.values = new TestDataValue();
305+
(option3.values as TestDataValue).weight = 143;
306+
(option3.values as TestDataValue).brand = "HTC";
307+
(option3.values as TestDataValue).price = 299;
308+
listOption.Add(option3);
309+
310+
problemToSolve.options = listOption.ToArray();
311+
312+
m_TradeoffAnalytics.GetDilemma( OnGetDilemma, problemToSolve, false );
313+
}
314+
315+
private void OnGetDilemma( DilemmasResponse resp )
316+
{
317+
Debug.Log("Response: " + resp);
318+
}
319+
320+
/// <summary>
321+
/// Application data value.
322+
/// </summary>
323+
public class TestDataValue : IBM.Watson.DeveloperCloud.Services.TradeoffAnalytics.v1.ApplicationDataValue
324+
{
325+
public double price { get; set; }
326+
public double weight { get; set; }
327+
public string brand { get; set; }
328+
}
329+
```
330+
331+
<!--### Conversation
216332
```cs
217333
private Conversation m_Conversation = new Conversation();
218334
private string m_WorkspaceID = "car_demo_1";
@@ -230,7 +346,26 @@ void OnMessage (DataModels.MessageResponse resp)
230346
231347
Debug.Log("response: " + resp.output.text);
232348
}
349+
```-->
350+
351+
<!--### Visual Recognition
352+
The [Visual Recognition][visual_recognition] service uses deep learning algorithms to analyze images for scenes, objects, faces, text and other content and returns keywords about that content. You can also train custom classifiers to classify images.
353+
354+
##### Classifying an image
355+
```
356+
```
357+
358+
##### Creating new classifiers
359+
```
360+
```
361+
362+
##### Detecting faces
363+
```
364+
```
365+
366+
##### Recognizing text
233367
```
368+
```-->
234369

235370
## Developing a basic application in one minute
236371
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:
@@ -280,3 +415,5 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
280415
[sentiment_analysis]: http://www.alchemyapi.com/products/alchemylanguage/sentiment-analysis
281416
[tone_analyzer]: http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/tone-analyzer/
282417
[tradeoff_analytics]: http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/tradeoff-analytics/
418+
[conversation]:http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/dialog/api/v1/
419+
[visual_recognition]:http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/visual-recognition/

0 commit comments

Comments
 (0)