diff --git a/Config.json.enc b/Config.json.enc index 3a1550f1f..845a2e056 100644 Binary files a/Config.json.enc and b/Config.json.enc differ diff --git a/Examples/ServiceExamples/Scripts/ExamplePersonalityInsights.cs b/Examples/ServiceExamples/Scripts/ExamplePersonalityInsights.cs old mode 100644 new mode 100755 index d5cb7c05a..ef83935b1 --- a/Examples/ServiceExamples/Scripts/ExamplePersonalityInsights.cs +++ b/Examples/ServiceExamples/Scripts/ExamplePersonalityInsights.cs @@ -22,7 +22,6 @@ public class ExamplePersonalityInsights : MonoBehaviour { PersonalityInsights m_personalityInsights = new PersonalityInsights(); - private string testString = "Facing certain defeat at the hands of a room-size I.B.M. computer on Wednesday evening, Ken Jennings, famous for winning 74 games in a row on the TV quiz show, acknowledged the obvious. \"I, for one, welcome our new computer overlords,\" he wrote on his video screen, borrowing a line from a \"Simpsons\" episode.\n\nFrom now on, if the answer is \"the computer champion on \"Jeopardy!,\" the question will be, \"What is Watson?\"\n\nFor I.B.M., the showdown was not merely a well-publicized stunt and a $1 million prize, but proof that the company has taken a big step toward a world in which intelligent machines will understand and respond to humans, and perhaps inevitably, replace some of them.\n\nWatson, specifically, is a \"question answering machine\" of a type that artificial intelligence researchers have struggled with for decades — a computer akin to the one on \"Star Trek\" that can understand questions posed in natural language and answer them.\n\nWatson showed itself to be imperfect, but researchers at I.B.M. and other companies are already developing uses for Watson's technologies that could have a significant impact on the way doctors practice and consumers buy products.\n\n\"Cast your mind back 20 years and who would have thought this was possible?\" said Edward Feigenbaum, a Stanford University computer scientist and a pioneer in the field.\n\nIn its \"Jeopardy!\" project, I.B.M. researchers were tackling a game that requires not only encyclopedic recall, but also the ability to untangle convoluted and often opaque statements, a modicum of luck, and quick, strategic button pressing.\n\nThe contest, which was taped in January here at the company's T. J. Watson Research Laboratory before an audience of I.B.M. executives and company clients, played out in three televised episodes concluding Wednesday. At the end of the first day, Watson was in a tie with Brad Rutter, another ace human player, at $5,000 each, with Mr. Jennings trailing with $2,000.\n\nBut on the second day, Watson went on a tear. By night's end, Watson had a commanding lead with a total of $35,734, compared with Mr. Rutter's $10,400 and Mr. Jennings's $4,800.\n\nVictory was not cemented until late in the third match, when Watson was in Nonfiction. \"Same category for $1,200,\" it said in a manufactured tenor, and lucked into a Daily Double. Mr. Jennings grimaced.\n\nEven later in the match, however, had Mr. Jennings won another key Daily Double it might have come down to Final Jeopardy, I.B.M. researchers acknowledged.\n\nThe final tally was $77,147 to Mr. Jennings's $24,000 and Mr. Rutter's $21,600.\n\nMore than anything, the contest was a vindication for the academic field of artificial intelligence, which began with great promise in the 1960s with the vision of creating a thinking machine and which became the laughingstock of Silicon Valley in the 1980s, when a series of heavily financed start-up companies went bankrupt.\n\nDespite its intellectual prowess, Watson was by no means omniscient. On Tuesday evening during Final Jeopardy, the category was U.S. Cities and the clue was: \"Its largest airport is named for a World War II hero; its second largest for a World War II battle.\"\n\nWatson drew guffaws from many in the television audience when it responded \"What is Toronto?????\"\n\nThe string of question marks indicated that the system had very low confidence in its response, I.B.M. researchers said, but because it was Final Jeopardy, it was forced to give a response. The machine did not suffer much damage. It had wagered just $947 on its result. (The correct answer is, \"What is Chicago?\")\n\n\"We failed to deeply understand what was going on there,\" said David Ferrucci, an I.B.M. researcher who led the development of Watson. \"The reality is that there's lots of data where the title is U.S. cities and the answers are countries, European cities, people, mayors. Even though it says U.S. cities, we had very little confidence that that's the distinguishing feature.\"\n\nThe researchers also acknowledged that the machine had benefited from the \"buzzer factor.\"\n\nBoth Mr. Jennings and Mr. Rutter are accomplished at anticipating the light that signals it is possible to \"buzz in,\" and can sometimes get in with virtually zero lag time. The danger is to buzz too early, in which case the contestant is penalized and \"locked out\" for roughly a quarter of a second.\n\nWatson, on the other hand, does not anticipate the light, but has a weighted scheme that allows it, when it is highly confident, to hit the buzzer in as little as 10 milliseconds, making it very hard for humans to beat. When it was less confident, it took longer to buzz in. In the second round, Watson beat the others to the buzzer in 24 out of 30 Double Jeopardy questions.\n\n\"It sort of wants to get beaten when it doesn't have high confidence,\" Dr. Ferrucci said. \"It doesn't want to look stupid.\"\n\nBoth human players said that Watson's button pushing skill was not necessarily an unfair advantage. \"I beat Watson a couple of times,\" Mr. Rutter said.\n\nWhen Watson did buzz in, it made the most of it. Showing the ability to parse language, it responded to, \"A recent best seller by Muriel Barbery is called 'This of the Hedgehog,' \" with \"What is Elegance?\"\n\nIt showed its facility with medical diagnosis. With the answer: \"You just need a nap. You don't have this sleep disorder that can make sufferers nod off while standing up,\" Watson replied, \"What is narcolepsy?\"\n\nThe coup de grâce came with the answer, \"William Wilkenson's 'An Account of the Principalities of Wallachia and Moldavia' inspired this author's most famous novel.\" Mr. Jennings wrote, correctly, Bram Stoker, but realized that he could not catch up with Watson's winnings and wrote out his surrender.\n\nBoth players took the contest and its outcome philosophically.\n\n\"I had a great time and I would do it again in a heartbeat,\" said Mr. Jennings. \"It's not about the results; this is about being part of the future.\"\n\nFor I.B.M., the future will happen very quickly, company executives said. On Thursday it plans to announce that it will collaborate with Columbia University and the University of Maryland to create a physician's assistant service that will allow doctors to query a cybernetic assistant. The company also plans to work with Nuance Communications Inc. to add voice recognition to the physician's assistant, possibly making the service available in as little as 18 months.\n\n\"I have been in medical education for 40 years and we're still a very memory-based curriculum,\" said Dr. Herbert Chase, a professor of clinical medicine at Columbia University who is working with I.B.M. on the physician's assistant. \"The power of Watson- like tools will cause us to reconsider what it is we want students to do.\"\n\nI.B.M. executives also said they are in discussions with a major consumer electronics retailer to develop a version of Watson, named after I.B.M.'s founder, Thomas J. Watson, that would be able to interact with consumers on a variety of subjects like buying decisions and technical support.\n\nDr. Ferrucci sees none of the fears that have been expressed by theorists and science fiction writers about the potential of computers to usurp humans.\n\n\"People ask me if this is HAL,\" he said, referring to the computer in \"2001: A Space Odyssey.\" \"HAL's not the focus; the focus is on the computer on 'Star Trek,' where you have this intelligent information seek dialogue, where you can ask follow-up questions and the computer can look at all the evidence and tries to ask follow-up questions. That's very cool.\""; void Start () { diff --git a/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs b/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs index fcfc5d362..f5f5080b0 100755 --- a/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs +++ b/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs @@ -35,10 +35,10 @@ void Start() { LogSystem.InstallDefaultReactors(); - // Get all classifiers - Log.Debug("ExampleVisualRecognition", "Attempting to get all classifiers"); - if (!m_VisualRecognition.GetClassifiers(OnGetClassifiers)) - Log.Debug("ExampleVisualRecognition", "Getting classifiers failed!"); + //// Get all classifiers + //Log.Debug("ExampleVisualRecognition", "Attempting to get all classifiers"); + //if (!m_VisualRecognition.GetClassifiers(OnGetClassifiers)) + // Log.Debug("ExampleVisualRecognition", "Getting classifiers failed!"); //// Find classifier by name //Log.Debug("ExampleVisualRecognition", "Attempting to find classifier by name"); @@ -56,11 +56,11 @@ void Start() //// Train classifier //Log.Debug("ExampleVisualRecognition", "Attempting to train classifier"); - //string m_positiveExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/giraffe_positive_examples.zip"; - //string m_negativeExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/negative_examples.zip"; + //string positiveExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/giraffe_positive_examples.zip"; + //string negativeExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/negative_examples.zip"; //Dictionary positiveExamples = new Dictionary(); - //positiveExamples.Add("giraffe", m_positiveExamplesPath); - //if (!m_VisualRecognition.TrainClassifier(OnTrainClassifier, "unity-test-classifier-example", positiveExamples, m_negativeExamplesPath)) + //positiveExamples.Add("giraffe", positiveExamplesPath); + //if (!m_VisualRecognition.TrainClassifier(OnTrainClassifier, "unity-test-classifier-example", positiveExamples, negativeExamplesPath)) // Log.Debug("ExampleVisualRecognition", "Train classifier failed!"); //// Classify get @@ -70,11 +70,11 @@ void Start() //// Classify post image //Log.Debug("ExampleVisualRecognition", "Attempting to classify via image on file system"); - //string m_imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg"; - //string[] m_owners = { "IBM", "me" }; - //string[] m_classifierIDs = { "default" }; - //if (!m_VisualRecognition.Classify(OnClassify, m_imagesPath, m_owners, m_classifierIDs, 0.5f)) - // Log.Debug("ExampleVisualRecognition", "Classify image failed!"); + //string imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg"; + //string[] owners = { "IBM", "me" }; + //string[] classifierIDs = { "default" }; + //if (!m_VisualRecognition.Classify(OnClassify, imagesPath, owners, classifierIDs, 0.5f)) + // Log.Debug("ExampleVisualRecognition", "Classify image failed!"); //// Detect faces get //Log.Debug("ExampleVisualRecognition", "Attempting to detect faces via URL"); @@ -83,8 +83,8 @@ void Start() //// Detect faces post image //Log.Debug("ExampleVisualRecognition", "Attempting to detect faces via image"); - //string m_faceExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg"; - //if (!m_VisualRecognition.DetectFaces(OnDetectFaces, m_faceExamplePath)) + //string faceExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg"; + //if (!m_VisualRecognition.DetectFaces(OnDetectFaces, faceExamplePath)) // Log.Debug("ExampleVisualRecognition", "Detect faces failed!"); //// Recognize text get @@ -94,8 +94,8 @@ void Start() //// Recognize text post image //Log.Debug("ExampleVisualRecognition", "Attempting to recognizeText via image"); - //string m_textExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/from_platos_apology.png"; - //if (!m_VisualRecognition.RecognizeText(OnRecognizeText, m_textExamplePath)) + //string textExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/from_platos_apology.png"; + //if (!m_VisualRecognition.RecognizeText(OnRecognizeText, textExamplePath)) // Log.Debug("ExampleVisualRecognition", "Recognize text failed!"); } diff --git a/Scripts/UnitTests/TestRetrieveAndRank.cs b/Scripts/UnitTests/TestRetrieveAndRank.cs index 7b73d334f..0ba9295b2 100755 --- a/Scripts/UnitTests/TestRetrieveAndRank.cs +++ b/Scripts/UnitTests/TestRetrieveAndRank.cs @@ -45,31 +45,35 @@ public class TestRetrieveAndRank : UnitTest //private RankerInfoPayload[] m_ExistingRankers; private bool m_GetClustersTested = false; - private bool m_CreateClusterTested = false; - private bool m_DeleteClusterTested = false; private bool m_GetClusterTested = false; private bool m_ListClusterConfigsTested = false; - private bool m_DeleteClusterConfigTested = false; private bool m_GetClusterConfigTested = false; - private bool m_UploadClusterConfigTested = false; private bool m_ListCollectionRequestTested = false; - private bool m_CreateCollectionRequestTested = false; - private bool m_DeleteCollectionRequestTested = false; - private bool m_IndexDocumentsTested = false; private bool m_StandardSearchTested = false; private bool m_RankedSearchTested = false; private bool m_GetRankersTested = false; - private bool m_CreateRankerTested = false; private bool m_RankTested = false; - private bool m_DeleteRankersTested = false; private bool m_GetRankerInfoTested = false; - private string m_ClusterToCreateName = "unity-integration-test-cluster"; - private string m_CreatedClusterID; private string m_ConfigToCreateName = "unity-integration-test-config"; private string m_CollectionToCreateName = "unity-integration-test-collection"; - private string m_RankerToCreateName = "unity-integration-test-ranker"; private string m_CreatedRankerID; + private string m_CreatedClusterID; + +#if TEST_CREATE_DELETE + private bool m_DeleteClusterTested = false; + private bool m_CreateClusterTested = false; + private bool m_DeleteClusterConfigTested = false; + private bool m_UploadClusterConfigTested = false; + private bool m_CreateCollectionRequestTested = false; + private bool m_DeleteCollectionRequestTested = false; + private bool m_IndexDocumentsTested = false; + private bool m_CreateRankerTested = false; + private bool m_DeleteRankersTested = false; + private string m_ClusterToCreateName = "unity-integration-test-cluster"; + private string m_RankerToCreateName = "unity-integration-test-ranker"; + private bool m_IsDoneWaiting = false; +#endif // from config variables private string m_ExampleClusterID; @@ -90,7 +94,6 @@ public class TestRetrieveAndRank : UnitTest private bool m_IsClusterReady = false; private bool m_IsRankerReady = false; - private bool m_IsDoneWaiting = false; public override IEnumerator RunTest() { m_IntegrationTestClusterConfigPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/RetrieveAndRank/cranfield_solr_config.zip"; @@ -103,7 +106,7 @@ public override IEnumerator RunTest() m_ExampleRankerID = Config.Instance.GetVariableValue("RetrieveAndRank_IntegrationTestRankerID"); m_ExampleCollectionName = Config.Instance.GetVariableValue("RetrieveAndRank_IntegrationTestCollectionName"); - #region delete existing +#region delete existing //// Get existing cluster data. //Log.Debug("TestRetrieveAndRank", "Getting existing clusters."); //m_RetrieveAndRank.GetClusters(OnGetExistingClusters); @@ -200,7 +203,7 @@ public override IEnumerator RunTest() // m_RetrieveAndRank.DeleteRanker(OnDeleteExistingRanker, ranker.ranker_id); // } //} - #endregion +#endregion // Get clusters Log.Debug("TestRetrieveAndRank", "*** Attempting to get clusters!"); @@ -369,11 +372,13 @@ public override IEnumerator RunTest() yield break; } +#if TEST_CREATE_DELETE private IEnumerator WaitUp(float waitTime) { yield return new WaitForSeconds(waitTime); m_IsDoneWaiting = true; } +#endif #region delete existing handlers //private void OnDeleteExistingCollection(CollectionsResponse resp, string data) @@ -510,6 +515,7 @@ private void OnGetClusters(SolrClusterListResponse resp, string data) m_GetClustersTested = true; } +#if TEST_CREATE_DELETE private void OnCreateCluster(SolrClusterResponse resp, string data) { Test(resp != null); @@ -524,6 +530,7 @@ private void OnCreateCluster(SolrClusterResponse resp, string data) m_CreateClusterTested = true; } +#endif private void OnGetCluster(SolrClusterResponse resp, string data) { @@ -544,6 +551,7 @@ private void OnGetCluster(SolrClusterResponse resp, string data) m_GetClusterTested = true; } +#if TEST_CREATE_DELETE private void OnDeleteCluster(bool success, string data) { Test(success); @@ -555,6 +563,7 @@ private void OnDeleteCluster(bool success, string data) m_DeleteClusterTested = true; } +#endif private void OnGetClusterConfigs(SolrConfigList resp, string data) { @@ -574,6 +583,7 @@ private void OnGetClusterConfigs(SolrConfigList resp, string data) m_ListClusterConfigsTested = true; } +#if TEST_CREATE_DELETE private void OnUploadClusterConfig(UploadResponse resp, string data) { Test(resp != null); @@ -597,6 +607,7 @@ private void OnDeleteClusterConfig(bool success, string data) m_DeleteClusterConfigTested = true; } +#endif private void OnGetClusterConfig(byte[] respData, string data) { @@ -612,6 +623,7 @@ private void OnGetClusterConfig(byte[] respData, string data) m_GetClusterConfigTested = true; } +#if TEST_CREATE_DELETE private void OnCreateCollections(CollectionsResponse resp, string data) { Test(resp != null); @@ -634,6 +646,7 @@ private void OnCreateCollections(CollectionsResponse resp, string data) m_CreateCollectionRequestTested = true; } +#endif private void OnListCollections(CollectionsResponse resp, string data) { @@ -665,6 +678,7 @@ private void OnListCollections(CollectionsResponse resp, string data) m_ListCollectionRequestTested = true; } +#if TEST_CREATE_DELETE private void OnDeleteCollections(CollectionsResponse resp, string data) { Test(resp != null); @@ -687,6 +701,7 @@ private void OnDeleteCollections(CollectionsResponse resp, string data) m_DeleteCollectionRequestTested = true; } +#endif private void OnGetRankers(ListRankersPayload resp, string data) { @@ -705,6 +720,7 @@ private void OnGetRankers(ListRankersPayload resp, string data) m_GetRankersTested = true; } +#if TEST_CREATE_DELETE private void OnCreateRanker(RankerStatusPayload resp, string data) { Test(resp != null); @@ -719,6 +735,7 @@ private void OnCreateRanker(RankerStatusPayload resp, string data) m_CreateRankerTested = true; } +#endif private void OnGetRanker(RankerStatusPayload resp, string data) { @@ -758,6 +775,7 @@ private void OnRank(RankerOutputPayload resp, string data) m_RankTested = true; } +#if TEST_CREATE_DELETE private void OnDeleteRanker(bool success, string data) { Test(success); @@ -792,6 +810,7 @@ private void OnIndexDocuments(IndexResponse resp, string data) m_IndexDocumentsTested = true; } +#endif private void OnStandardSearch(SearchResponse resp, string data) { diff --git a/Travis/runTests.sh b/Travis/runTests.sh index 6b5944ef8..e9c013a38 100755 --- a/Travis/runTests.sh +++ b/Travis/runTests.sh @@ -27,7 +27,8 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then -silent-crashes \ -logFile $(pwd)/integrationTests.log \ -projectPath $(pwd)/Travis/UnityTestProject \ - -executemethod IBM.Watson.DeveloperCloud.Editor.TravisIntegrationTests.RunTests + -executemethod IBM.Watson.DeveloperCloud.Editor.TravisIntegrationTests.RunTests \ + -quit if [ $? = 0 ] ; then echo "UnitTest COMPLETED! Exited with $?" exit 0