Example #1
0
        public HowAreYouDialog(SentimentAnalysisService sentimentAnalysisService, EmotionApi emotionApi)
            : base("HowAreYou")
        {
            Check.Required <ArgumentNullException>(() => sentimentAnalysisService != null);
            Check.Required <ArgumentNullException>(() => emotionApi != null);

            _sentimentAnalysisService = sentimentAnalysisService;
            _emotionApi = emotionApi;
        }
Example #2
0
 /// <summary>
 ///     Initializes the services (it's based on the Dependency Injection pattern)
 /// </summary>
 private static void Init()
 {
     if (_container == null)
     {
         ServiceUtils.Init();
         _container = Container.GetInstance();
         _entityExtractionService   = _container.Resolve <EntityExtractionService>();
         _languageDetectionService  = _container.Resolve <LanguageDetectionService>();
         _sentimentAnalysisService  = _container.Resolve <SentimentAnalysisService>();
         _textClassificationService = _container.Resolve <TextClassificationService>();
         _textSimilarityService     = _container.Resolve <TextSimilarityService>();
         _wikisearchService         = _container.Resolve <WikisearchService>();
         _customSpotService         = _container.Resolve <CustomSpotService>();
         _customModelService        = _container.Resolve <CustomModelService>();
     }
 }
Example #3
0
        public Sonequa(ILogger <Sonequa> logger, SonequaSettings options, SentimentAnalysisService sentimentAnalysisService)
        {
            _logger  = logger;
            _options = options;
            _sentimentAnalysisService = sentimentAnalysisService;

            connectionCredentials = new ConnectionCredentials(_options.BotUsername, _options.BotToken);

            connection = new HubConnectionBuilder()
                         .WithUrl(_options.SonequaWebUrl)
                         .Build();

            connection.Closed += async(error) =>
            {
                await Task.Delay(new Random().Next(0, 5) * 1000);

                await connection.StartAsync();
            };
        }
 public SentimentAnalysisValidationTests(ServiceFixture fixture)
 {
     _fixture = fixture;
     _sentimentAnalysisService = fixture.SentimentAnalysisService;
 }