Duckling tutorial

!!! as of 1 May 2017 duckling switched from Cojure to Haskell, so beware for dated documentation where they still use Cojure.

Don't use duckling.wit.ai too much as it still describes the version that's written in Cojure.

github: https://github.com/facebookincubator/duckling

Getting started

  1. Duckling is build with Haskell, install stack to parse the Haskell commands.

Adding a dimension

[language]= your language's ISO-639-1 standard

  1. Go to Duckling/[dimension]/EN and copy the Corpus.hs and Rules.hs files into Duckling/[dimension]/[language]/
  2. Start with Corpus.hs, translate the strings within the examples.
  3. Then edit Rules.hs. First check if all rules apply to you language, if they do, translate them, delete them if they do not.
  4. Now check if it's necessary to add/extend rules in Rules.hs, give them logic names. Add those names at the end of Rules.hs
  5. Go to Duckling/Rules/[language].hs and add an import for your rules

    import qualified Duckling.[dimension].HU.Rules as [dimension]
    

    extend the list of rules by replacing [] with [dimension].rules .

  6. Go to duckling.cabal and go to:

    --Dimensions
        --[dimension]
    

    and add:

    , Duckling.[dimension].[Language].Corpus
    , Duckling.[dimension].[Language].Rules
    

    then go to:

    --Dimensions
        , Duckling.Dimensions.Tests
        --[dimensions]
    

    and add:

    , Duckling.[dimension].[language].Tests
    
  7. Go to tests/Duckling/[dimension]/EN and copy the Tests.hs file to tests/Duckling/[dimension]/[language]. Adjust the file to your language (Just change all "EN" to [language]).

  8. Now, go to tests/Duckling/[dimension]/Tests.hs and add

    import qualified Duckling.[dimension].[language].Tests as [language]
    

    then add [language].tests in the TestTree.

  9. Add your dimension to duckling/Duckling/Dimensions/[language].hs

  10. Finally, run following command to run tests:

     stack build :duckling-regen-exe && stack exec duckling-regen-exe && stack test
    

Log

Duration:

bug:

Log

Duration:

bug:

results matching ""

    No results matching ""