stanford-oval / genie-toolkit

The Genie open source kit for voice assistant (formerly known as Almond)
Apache License 2.0
193 stars 35 forks source link

Can't generate synthetic sentences #126

Closed tho-clare-ai closed 4 years ago

tho-clare-ai commented 4 years ago

Hi, I follow the guidelines on: https://github.com/stanford-oval/genie-toolkit/blob/master/README.md. But I was stuck at Step 1: which is generating the synthetic sentences. The command I used: genie generate --locale en --template ~/genie-toolkit/languages/thingtalk/en/thingtalk.genie --thingpedia thingpedia.tt --entities entities.json --dataset dataset.tt -o synthesized.tsv The environment: MacOS Mojave version 10.14.6. Nodejs: v10.19.0 The error I faced:

Batched schema-meta request for org.thingpedia.builtin.thingengine.builtin

Loaded 139 devices
Loaded 997 templates
Loaded type Entity__almond.sports__am_soccer_leagues as generic entity
Loaded type Entity__almond.sports__eu_soccer_leagues as generic entity
Loaded type Entity__almond.sports__nhl_team as generic entity
Loaded type Entity__com.facebook__id as id type
Loaded type Entity__com.gmail__email_id as non-constant type
Loaded type Entity__com.gmail__thread_id as non-constant type
Loaded type Entity__com.google.contacts__contact_name as non-constant type
Loaded type Entity__com.google.drive__file_id as non-constant type
Loaded type Entity__com.icanhazdadjoke__id as id type
Loaded type Entity__com.imgur__album_id as non-constant type
Loaded type Entity__com.instagram__filter_ as generic entity
Loaded type Entity__com.live.onedrive__file_id as non-constant type
Loaded type Entity__com.live.onedrive__user_id as non-constant type
Loaded type Entity__com.steampowered__user_id as non-constant type
Loaded type Entity__com.thecatapi__image_id as non-constant type
Loaded type Entity__com.twitter__id as id type
Loaded type Entity__com.youtube__channel_id as non-constant type
Loaded type Entity__com.youtube__video_id as non-constant type
Loaded type Entity__dogapi__image_id as non-constant type
Loaded type Entity__gov.nasa__asteroid_id as non-constant type
Loaded type Entity__gov.nasa__curiosity_rover_camera as generic entity
Loaded type Entity__imgflip__meme_id as generic entity
Loaded type Entity__instagram__media_id as non-constant type
Loaded type Entity__omlet__feed_id as non-constant type
Loaded type Entity__org.arxiv__category as generic entity
Loaded type Entity__org.freedesktop__app_id as generic entity
Loaded type Entity__org.wikidata__human as generic entity
Loaded type Entity__org.wikidata__league as generic entity
Loaded type Entity__rest.kanye__id as id type
Loaded type Entity__sportradar__eu_soccer_team as generic entity
Loaded type Entity__sportradar__eu_tournament as generic entity
Loaded type Entity__sportradar__mlb_team as generic entity
Loaded type Entity__sportradar__nba_team as generic entity
Loaded type Entity__sportradar__ncaafb_team as generic entity
Loaded type Entity__sportradar__ncaambb_team as generic entity
Loaded type Entity__sportradar__nfl_team as generic entity
Loaded type Entity__sportradar__us_soccer_team as generic entity
Loaded type Entity__sportradar__us_tournament as generic entity
Loaded type Entity__tt__country as generic entity
Loaded type Entity__tt__cryptocurrency_code as generic entity
Loaded type Entity__tt__currency_code as generic entity
Loaded type Entity__tt__iso_lang_code as generic entity
Loaded type Entity__tt__mime_type as generic entity
Loaded type Entity__tt__stock_id as generic entity
Loaded type Entity__tt__contact as non-constant type
Loaded type Entity__tt__contact_name as non-constant type
Loaded type Entity__tt__device as non-constant type
Loaded type Entity__tt__email_address as non-constant type
Loaded type Entity__tt__flow_token as non-constant type
Loaded type Entity__tt__function as non-constant type
Loaded type Entity__tt__hashtag as non-constant type
Loaded type Entity__tt__path_name as non-constant type
Loaded type Entity__tt__phone_number as non-constant type
Loaded type Entity__tt__picture as non-constant type
Loaded type Entity__tt__program as non-constant type
Loaded type Entity__tt__url as non-constant type
Loaded type Entity__tt__username as non-constant type
{ SyntaxError: Expected "$", "$root", "context", "for", "if", "import", comment, end of input, end of line, identifier, or whitespace but "{" found.
    at peg$buildStructuredError (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/grammar.js:610:12)
    at Object.peg$parse [as parse] (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/grammar.js:7180:11)
    at parse (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/index.js:84:34)
  message:
   'Expected "$", "$root", "context", "for", "if", "import", comment, end of input, end of line, identifier, or whitespace but "{" found.',
  expected:
   [ { type: 'other', description: 'whitespace' },
     { type: 'other', description: 'end of line' },
     { type: 'other', description: 'comment' },
     { type: 'other', description: 'identifier' },
     { type: 'literal', text: '$root', ignoreCase: false },
     { type: 'literal', text: '$', ignoreCase: false },
     { type: 'other', description: 'identifier' },
     { type: 'literal', text: '$root', ignoreCase: false },
     { type: 'literal', text: '$', ignoreCase: false },
     { type: 'literal', text: 'context', ignoreCase: false },
     { type: 'literal', text: 'for', ignoreCase: false },
     { type: 'literal', text: 'if', ignoreCase: false },
     { type: 'literal', text: 'import', ignoreCase: false },
     { type: 'end' } ],
  found: '{',
  location:
   { start: { offset: 2014, line: 84, column: 1 },
     end: { offset: 2015, line: 84, column: 2 } },
  name: 'SyntaxError' }
{ SyntaxError: Expected "$", "$root", "context", "for", "if", "import", comment, end of input, end of line, identifier, or whitespace but "{" found.
    at peg$buildStructuredError (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/grammar.js:610:12)
    at Object.peg$parse [as parse] (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/grammar.js:7180:11)
    at parse (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/index.js:84:34)
  message:
   'Expected "$", "$root", "context", "for", "if", "import", comment, end of input, end of line, identifier, or whitespace but "{" found.',
  expected:
   [ { type: 'other', description: 'whitespace' },
     { type: 'other', description: 'end of line' },
     { type: 'other', description: 'comment' },
     { type: 'other', description: 'identifier' },
     { type: 'literal', text: '$root', ignoreCase: false },
     { type: 'literal', text: '$', ignoreCase: false },
     { type: 'other', description: 'identifier' },
     { type: 'literal', text: '$root', ignoreCase: false },
     { type: 'literal', text: '$', ignoreCase: false },
     { type: 'literal', text: 'context', ignoreCase: false },
     { type: 'literal', text: 'for', ignoreCase: false },
     { type: 'literal', text: 'if', ignoreCase: false },
     { type: 'literal', text: 'import', ignoreCase: false },
     { type: 'end' } ],
  found: '{',
  location:
   { start: { offset: 2014, line: 84, column: 1 },
     end: { offset: 2015, line: 84, column: 2 } },
  name: 'SyntaxError' }

/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/tool/genie.js:13
process.on('unhandledRejection', (up) => { throw up; });
                                           ^
SyntaxError: Expected "$", "$root", "context", "for", "if", "import", comment, end of input, end of line, identifier, or whitespace but "{" found.
    at peg$buildStructuredError (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/grammar.js:610:12)
    at Object.peg$parse [as parse] (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/grammar.js:7180:11)
    at parse (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/genie-compiler/index.js:84:34)
Emitted 'error' event at:
    at _initialization.then.catch (/Users/ThoNguyen/.config/yarn/global/node_modules/genie-toolkit/lib/sentence-generator/index.js:660:18)

Can you please point me where i'm wrong and how to fix it. Thanks in advanced

gcampax commented 4 years ago

What version of Genie is this? You should make sure to use the same version of Genie as the templates, and it looks like you're using Genie from NPM but the templates from Git.

tho-clare-ai commented 4 years ago

Thanks, let me try with your advise.

gcampax commented 4 years ago

I'm going to assume this has been fixed since. Please reopen if you still experience this issue.