From 2e50aa5ea004ceac952931bc2774d85ceafaa921 Mon Sep 17 00:00:00 2001 From: Julien Odent Date: Mon, 13 Mar 2017 11:38:34 -0700 Subject: [PATCH] Fix 'tomorrow July' + IT fixes Summary: * we weren't checking the right reference time in `takeNth` and `takeN` * fixing resulting failing tests for `IT` * `analyzedNTest` to check that input results in `n` parsed tokens Reviewed By: niteria Differential Revision: D4698788 fbshipit-source-id: 2cd4762 --- Duckling/Ranking/Classifiers/DA.hs | 517 +++++++++-------- Duckling/Ranking/Classifiers/DE.hs | 390 ++++++------- Duckling/Ranking/Classifiers/EN.hs | 874 +++++++++++++++-------------- Duckling/Ranking/Classifiers/FR.hs | 637 ++++++++++----------- Duckling/Ranking/Classifiers/IT.hs | 732 ++++++++++++------------ Duckling/Ranking/Classifiers/KO.hs | 262 ++++----- Duckling/Ranking/Classifiers/NB.hs | 524 +++++++++-------- Duckling/Ranking/Classifiers/PL.hs | 615 ++++++++++---------- Duckling/Ranking/Classifiers/SV.hs | 547 +++++++++--------- Duckling/Testing/Asserts.hs | 7 +- Duckling/Time/EN/Tests.hs | 9 + Duckling/Time/Helpers.hs | 10 +- Duckling/Time/IT/Corpus.hs | 6 - Duckling/Time/IT/Rules.hs | 8 +- 14 files changed, 2587 insertions(+), 2551 deletions(-) diff --git a/Duckling/Ranking/Classifiers/DA.hs b/Duckling/Ranking/Classifiers/DA.hs index a9d29c6c..cb195375 100644 --- a/Duckling/Ranking/Classifiers/DA.hs +++ b/Duckling/Ranking/Classifiers/DA.hs @@ -56,172 +56,159 @@ classifiers likelihoods = HashMap.fromList [], n = 0}}), ("intersect2", Classifier{okData = - ClassData{prior = -0.5817214453990283, unseen = -5.937536205082426, + ClassData{prior = -0.4981471655062198, unseen = -5.808142489980444, likelihoods = HashMap.fromList [(" - (interval)on ", - -4.143134726391533), + -4.013375499688434), (" - (interval)on ", - -4.143134726391533), - ("hourday", -5.241747015059643), - ("dayhour", -2.9904552164531473), - ("daymonth", -2.890371757896165), - ("monthyear", -3.044522437723423), - ("the (ordinal)named-month", - -3.9889840465642745), + -4.013375499688434), + ("hourday", -5.111987788356543), + ("dayhour", -2.8606959897500484), + ("daymonth", -3.0970847678142785), + ("monthyear", -3.0325462466767075), + ("the (ordinal)named-month", -3.859224819861175), ("intersect by \"of\", \"from\", \"'s\"year", - -4.836281906951478), - ("intersect2hh:mm", -5.241747015059643), - ("last of