From e1641aeba402aa59495b449b0cb72bcc55b002c2 Mon Sep 17 00:00:00 2001 From: Lautaro Emanuel Date: Wed, 10 Nov 2021 10:26:21 -0800 Subject: [PATCH 1/9] Added missing 'TR' time test cases (#661) Summary: Fixes https://github.com/facebook/duckling/issues/660. Pull Request resolved: https://github.com/facebook/duckling/pull/661 Test Plan: :test Duckling.Time.TR.Tests Reviewed By: stroxler Differential Revision: D32145794 Pulled By: chessai fbshipit-source-id: 4d55043f133b8238e9e8360264a3fbea6af2d022 --- Duckling/Ranking/Classifiers/TR_XX.hs | 1228 ++++++++++++++++++++++++- Duckling/Time/TR/Corpus.hs | 14 +- Duckling/Time/TR/Rules.hs | 85 +- duckling.cabal | 1 + exe/Duckling/Ranking/Generate.hs | 3 +- tests/Duckling/Time/Tests.hs | 2 + 6 files changed, 1272 insertions(+), 61 deletions(-) diff --git a/Duckling/Ranking/Classifiers/TR_XX.hs b/Duckling/Ranking/Classifiers/TR_XX.hs index d31da2698..433cf07e4 100644 --- a/Duckling/Ranking/Classifiers/TR_XX.hs +++ b/Duckling/Ranking/Classifiers/TR_XX.hs @@ -19,4 +19,1230 @@ import qualified Data.HashMap.Strict as HashMap import Duckling.Ranking.Types classifiers :: Classifiers -classifiers = HashMap.fromList [] \ No newline at end of file +classifiers + = HashMap.fromList + [("week", + Classifier{okData = + ClassData{prior = 0.0, unseen = -1.0986122886681098, + likelihoods = HashMap.fromList [("", 0.0)], n = 1}, + koData = + ClassData{prior = -infinity, unseen = -0.6931471805599453, + likelihoods = HashMap.fromList [], n = 0}}), + ("integer (numeric)", + Classifier{okData = + ClassData{prior = -0.4302451371066514, unseen = -4.553876891600541, + likelihoods = HashMap.fromList [("", 0.0)], n = 93}, + koData = + ClassData{prior = -1.0508216248317612, unseen = -3.951243718581427, + likelihoods = HashMap.fromList [("", 0.0)], n = 50}}), + ("Sal\305", + Classifier{okData = + ClassData{prior = 0.0, unseen = -2.639057329615259, + likelihoods = HashMap.fromList [("", 0.0)], n = 12}, + koData = + ClassData{prior = -infinity, unseen = -0.6931471805599453, + likelihoods = HashMap.fromList [], n = 0}}), + ("lunch", + Classifier{okData = + ClassData{prior = 0.0, unseen = -1.0986122886681098, + likelihoods = HashMap.fromList [("", 0.0)], n = 1}, + koData = + ClassData{prior = -infinity, unseen = -0.6931471805599453, + likelihoods = HashMap.fromList [], n = 0}}), + ("Ramazan Bayram\305", + Classifier{okData = + ClassData{prior = 0.0, unseen = -2.3025850929940455, + likelihoods = HashMap.fromList [("", 0.0)], n = 8}, + koData = + ClassData{prior = -infinity, unseen = -0.6931471805599453, + likelihoods = HashMap.fromList [], n = 0}}), + ("