Code Monkey home page Code Monkey logo

jovo-model's People

Contributors

aswetlow avatar dependabot[bot] avatar dominik-meissner avatar github-actions[bot] avatar jankoenig avatar janober avatar m-ripper avatar mistic92 avatar palle-k avatar rmtuckerphx avatar rubenaeg avatar sadlowskij avatar timvermaercke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jovo-model's Issues

Google Actions: Disallowed training phrases?

This is a weird one, and maybe something is breaking farther upstream, but I got the following error:

{
  "error": {
    "code": 400,
    "message": "Invalid value at 'files.config_files.config_files[27].intent.training_phrases[0]' (TYPE_STRING), true",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid value at 'files.config_files.config_files[27].intent.training_phrases[0]' (TYPE_STRING), true",
            "field": "files.config_files.config_files[27].intent.training_phrases[0]"
          }
        ]
      }
    ]
  }
}

The error resolved when I removed the following training phrases from my intents:

  • yes
  • no
  • off

I have no idea why this is the case :-(

[v4] State of model conversions from Jovo to Platforms

Hi, I'm wondering if you could provide some advice to get the Jovo Model to Rasa / Lex models conversion working.

I can also try to implement something, but I don't know the state of this.

Rasa

For example, I tried this and it works, I end up with a json like this:

{
  "rasa_nlu_data": {
    "common_examples": [
      {
        "text": "Element",
        "intent": "NameInputType",
        "entities": [
          {
            "value": "Element",
            "entity": "NameInputType",
            "start": 0,
            "end": 7
          }
        ]
      },
      ...

  
    ],
    "entity_synonyms": [],
    "lookup_tables": [
      {
        "name": "NameInputType",
        "elements": [
          "Element"
        ]
      }
    ]
  }
}

that I don't know how to use in Rasa. Is it possible to do something with this file to be able to use Rasa in Jovo Debugger?

Lex

I can convert a simple model to Lex, but I can only import it in v1 console.
It seems that it is not implemented for v2. Could you provide suggestions on this? Source code to modify... something that can help if I can study the conversion.

Thank you

Google Actions: Webhook handler does not include name

If I attempt to deploy using gactions push, I get the following error:

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Event handler contains function call named 'Jovo' which is not present in the interaction model."
          }
        ]
      }
    ]
  }
}

The problem resolves by fixing the webhook file by adding the first two lines of the following snippet:

handlers:
- name: Jovo
httpsEndpoint:
  baseUrl: <some_url>
  endpointApiVersion: 2

Trigger phrase is missing... Locale: 'en'.

It seems that gactions push isn't quite happy with the paths emitted by jovo-model: intents/en-US/Foo.yaml.

en      Trigger phrase is missing for custom intent 'Foo'. Locale: 'en'.             

If I take the entire contents of en-US and drop them directly into the intents folder, the push succeeds.

Google Actions: AMAZON.YesIntent is invalid

I believe the jovo-cli on dialogflow used to take care of normalizing these intents into just YesIntent etc. I'm now rolling my own CLI by utilizing jovo-model.

I'm not sure if that falls within the scope of this library or if that's something I should be handling in my own code. Would love some clarity!

actions.type.Time seems to break gactions push

From my model:

                {
			"name": "TimeOnlyIntent",
			"phrases": [
				"{time}"
			],
			"inputs": [
				{
					"name": "time",
					"type": {
						"alexa": "AMAZON.TIME",
						"googleAssistant": "actions.type.Time"
					}
				}
			]
		}

The emitted file:

trainingPhrases:
  - ($time '' auto=true)

The error:

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Intent training phrase: '($time '' auto=true)' has the wrong format. SyntaxError (1:8): missing SINGLE_QUOTED_TEXT at '''"
          }
        ]
      }
    ]
  }
}

Empty sampleValue in google conversation action

The for-loop which contains the following line generates 2 elements: the first one contains a valid sample value taken from the slot type, but the second one is an empty string and google api gives an error.

phrase = phrase.replace(matched, `($${input} '${sampleValue}' auto=true)`);

Example:

"trainingPhrases":
  - "($name 'clock-tic-tac' auto=true)"
  - "($count '' auto=true)"

Fix jovo-model-nlpjs to allow for regex and built-in entities for number, ordinal, date, time

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request
  • Other... Please describe:

Expected Behavior

NLP.js allows for specifying entities of various types including regex and depending on configured settings can handle various builtin types such as number, ordinal, date, and time.

These built-in entity types are defined based on specified packages such as builtin-microsoft:
https://github.com/axa-group/nlp.js/blob/581b945b19a4c0205d85e4b575b6542a4b69372b/packages/builtin-microsoft/src/builtin-microsoft.js#L85-L103

The JovoModel v4 structure is converted to an NLP.js corpus.json file but it appears that it only supports entities of type enum as can be seen from the interface that expects an options:

export interface NlpjsEntity {
options: Record<string, string[]>;
}
// Native NpJs JSON Format
export interface NlpjsModelFile {
name: string;
locale: string;
data: NlpjsData[];
entities?: Record<string, NlpjsEntity>;
}

Here is a sample corpus that shows an enum entity (hero) and a regex entity (email):

{
  "entities": {
    "hero": {
      "options": {
        "spiderman": ["spiderman", "spider-man"],
        "ironman": ["ironman", "iron-man"],
        "thor": ["thor"]
      }
    },
    "email": "/\\b(\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,3})\\b/gi"
  }
}

Full sample is here

Tasks:

  1. Figure out a format when specifying a non-enum entity in the Jovo Model v4 format.
    Something like:
"entities": {
  "animal": {
    "type": "ANIMAL_SYNONYMS" // enum type
  },
  "size": {
    "type": "ANIMAL_SIZE" // enum type
  },
  "number": {
    "type": {
      "nlpjs": "builtin-microsoft::Number"
    }
  },
  "email": {
    "type": {
      "nlpjs": "regex::/\\b(\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,3})\\b/gi"
    }
  }
}
  1. Update jovo-model-nlpjs so that it can handle non-enum entities
  2. Allow passing the needed configuration values to NLP.js whether you are using that as the NLU for the Jovo Debugger on in your Jovo app.

Current Behavior

Can only use enum types in NLP.js when you specify the model in Jovo Model v4 format.

Error Log

No error.

Your Environment

  • Jovo Framework version used: 4.2.12
  • Operating System: Windows 10 10.0.22000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.