public async Task TextMatchAsync(TextMatchBankStatement3Command command, ITextClassifier matcher) { var unmatched = State.PredictionResults.Where(x => x.PredictedValue == SubCategories.Uncategorised).ToArray(); Trace.WriteLine($"{Id} unmatched {unmatched.Count()}"); var matched = new List <KeyValuePair <PredictionResult, TextClassificationResult> >(); foreach (var item in unmatched) { item.Method = PredictionMethod.KeywordMatch; var result = await matcher.Match(item.Request.Description); if (result.Classifier != null && result.Classifier.SubCategory != SubCategories.Uncategorised) { matched.Add(new KeyValuePair <PredictionResult, TextClassificationResult>(item, result)); } } Trace.WriteLine($"{Id} matched {matched.Count()}"); var ev = new BankStatementTextMatched3Event { Unmatched = unmatched, Matched = matched }; Emit(ev); await Task.CompletedTask; }
public DataImporter(IBusControl busControl, ITextClassifier textClassifier, IRepository <Classifier> classifierRepository, IRepository <Company> companiesRepository, IRepository <Locality> localitiesRepository, IRepository <Charge> chargesRepository) { _busControl = busControl; _textClassifier = textClassifier; _classifierRepository = classifierRepository; _companiesRepository = companiesRepository; _localitiesRepository = localitiesRepository; _chargesRepository = chargesRepository; }
public PredictorShould() { var dataFixture = new DataFixture(); dataFixture.Init(); _predict = new Predict(); _textClassifier = new TextMatcher(dataFixture.Companies, dataFixture.Localities, dataFixture.Classifiers) { UseCache = false }; _account = dataFixture.GetTestBankAccount(); }
public CompletionClassifierAggregator(ITextClassifierAggregatorService textClassifierAggregatorService, ICompletionClassifier[] completionClassifiers) { if (textClassifierAggregatorService == null) { throw new ArgumentNullException(nameof(textClassifierAggregatorService)); } if (completionClassifiers == null) { throw new ArgumentNullException(nameof(completionClassifiers)); } this.textClassifierAggregator = textClassifierAggregatorService.Create(new ITextClassifier[] { new TextClassifier(this) }); this.completionClassifiers = completionClassifiers; }
public TaggedTextElementProvider(ITextClassifierAggregatorService textClassifierAggregatorService, IClassificationFormatMap classificationFormatMap, ITextClassifier[] classifiers) { if (textClassifierAggregatorService == null) { throw new ArgumentNullException(nameof(textClassifierAggregatorService)); } if (classificationFormatMap == null) { throw new ArgumentNullException(nameof(classificationFormatMap)); } if (classifiers == null) { throw new ArgumentNullException(nameof(classifiers)); } this.classifier = textClassifierAggregatorService.Create(classifiers); this.classificationFormatMap = classificationFormatMap; }
public TextMatchBankStatement3CommandHandler(ITextClassifier textClassifier) { _textClassifier = textClassifier; }
public ChargeController(ITextClassifier textClassifier) { TextClassifier = textClassifier; }
public ChargeRefreshHandler(ITextClassifier textClassifier, IGooglePlacesSearcher googlePlacesSearcher, IRepository <GoogleApiSearchResponse> repository) { _textClassifier = textClassifier; _googlePlacesSearcher = googlePlacesSearcher; _repository = repository; }
public FeedController(IFeed feed, IAdmin admin, ITextClassifier textClassifier) { _feed = feed; _admin = admin; _textClassifier = textClassifier; }
public ChargeSeedHandler(ITextClassifier textClassifier) { _textClassifier = textClassifier; }
public VersionController(Predict predict, ITextClassifier textClassifier) { _predict = predict; _textClassifier = textClassifier; }