Exemplo n.º 1
0
        static void TestSentimentAnalysis()
        {
            var engine = new ReviewSentimentAnalyzer(SENTIMENT_MODEL_PATH);
            var output = engine.Predict(new ModelInput
            {
                Text = "This service give me a good mood. I wanna go there more"
            });

            Console.WriteLine(output.Prediction + "-" + output.Score);
        }
Exemplo n.º 2
0
        static void TestIntegration()
        {
            var rData   = "We had lunch at the Mix, Greec... a very big plate but no taste. Everything was very greasy. The young people that Work there are very sweet but too eager to clean the table. A Customer needs space. No need to remove your glass or napkin. As the standing en watching. It is clean and nice decorated!!";
            var sEngine = new ReviewSentimentAnalyzer(SENTIMENT_MODEL_PATH);
            var sOutput = sEngine.Predict(new ModelInput
            {
                Text = rData
            });

            Console.WriteLine(sOutput.Prediction + "-" + sOutput.Score);
            var cEngine = new ReviewCategorizer(CLASSIFY_MODEL_PATH);
            var cOutput = cEngine.Predict(new Classification.Models.ModelInput
            {
                Review = rData
            });

            foreach (var r in cOutput.TopOutputs)
            {
                Console.WriteLine(r.Label + "-" + r.Score);
            }
        }