question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rasa NLU response parsing error

See original GitHub issue

Hi

When trying to integrate RASA NLU, an exception is thrown when the NLU training set contains entities that are resolved.

(From the console): jaicf.activator.rasa.api.RasaApi - Cannot parse RasaParseMessageRequest(text=…, messageId=30eed22e-e5e8-4960-a979-6485d5295f45) kotlinx.serialization.MissingFieldException: Field ‘confidence’ is required, but it was missing

From RASA output (using rasa train shell), we see a structure like this:

{
      "entity": "frequency",
      "start": 9,
      "end": 18,
      "confidence_entity": 0.9578643441200256,
      "value": "7",
      "extractor": "DIETClassifier",
      "processors": [
        "EntitySynonymMapper"
      ]
    }

But the mapping in RasaParseMessageResponse.kt contains:

@Serializable
data class Entity(
    val start: Int,
    val end: Int,
    val confidence: Float,
    val value: String,
    val entity: String
)

Maybe the confidence field should be renamed ‘confidence_entity’ to map correctly the output?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nikvoloshincommented, Apr 22, 2022

We’ll definitely look into it when it’s released and when we are ready to move on the next major Kotlin release.

As for now, we will release 1.2.4 version with the fix in a few days.

Thanks!

1reaction
nikvoloshincommented, Apr 22, 2022

We’ve added default nulls to all nullable properties. Now Rasa model classes should fully conform official API Spec. To deal with custom classifier’s fields we’ve added additional property rawResponse to RasaActivatorContext in JAICF 1.2.3 release. So now you should be able to access all of the custom fields from response through RasaActivatorContext#rawResponse property and Kotlin extension properties can help to build a fluent API, hiding all underlying JSON manipulations. You can find sample test here

So with such a fix I think using different classifiers won’t be a big problem, will it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in HTTP POST requests - RESTfulAPI - Rasa Open Source
Error: Failed when parsing body as json","reason":"ParsingError","details":{},"help":null,"code":500}. And I found this in the container ...
Read more >
NLU server - ParsingError · Issue #4024 · RasaHQ/rasa - GitHub
The issue appears when I try to reach the "/model/parse" endpoint on the NLU server to get predictions. If the cURL command is...
Read more >
Failed when parsing body as json - call Rasa API with request ...
I found the solution: Only need to use json.dumps() the object, because object in Python is different than object in json.
Read more >
Cannot get intent from Rasa server - Rhasspy Voice Assistant
Hi! I installed rasa on the same directory that I have rhasspy and I started running the server. The problem is that I...
Read more >
How to use the rasa.core.channels.channel.UserMessage ...
To help you get started, we've selected a few rasa.core.channels.channel. ... async def test_parsing(default_processor: MessageProcessor): message ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found