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.

Error in interpolate_text when value contains 0[

See original GitHub issue

Rasa version:

1.3.4

Rasa X version (if used & relevant):

Python version:

3.7

Operating system (windows, osx, …):

Windows

Issue:

Rasa fails to interpolate a template when one of the values contains a 0[. The code that triggers the error is here:

https://github.com/RasaHQ/rasa/blob/master/rasa/core/nlg/interpolator.py#L19

My response contains an a string np0[0...n] in one of the values (the {result} placeholder in the traceback below). All values are inserted correctly into the template, so the additional template.format({}) fails and triggers the except. Even the error message is wrong, as Rasa complains a missing value but inserted all values happily before. So the traceback below shows a wrong error, but at least the correct line.

Error (including full traceback):

2019-10-02 10:26:32 ERROR    rasa.core.nlg.interpolator  - Failed to fill utterance template 'Top {number_of_results} {documents} zum Thema {topic}:
{result}'. Tried to replace 'number_of_results' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the template. Return template without filling the template.
Traceback (most recent call last):
  File "c:\users\z003y0rv\projects\code.siemens\ai4am-chatbot\venv\lib\site-packages\rasa\core\nlg\interpolator.py", line 25, in interpolate_text
    return template.format({})
KeyError: 'number_of_results'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pboudacommented, Nov 8, 2019

At the moment I do not have access to the code of the project unfortunately. Before I got passed the issue by replacing all 0[ in my texts, though. I will get back to the project later this month and try to reproduce, then I can compare check all the slots and see why the error occurs exactly.

0reactions
stale[bot]commented, Mar 18, 2020

This issue has been automatically closed due to inactivity. Please create a new issue if you need more help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR IN LINEAR INTERPOLATION
The case n = 10 is in the text on page 127. It can be proven that for this function, the maximum error...
Read more >
How to format interpolation within error message string
How do I format the interpolation: #{self.lower_price_estimate + (self.lower_price_estimate * (1/10.0))} within the string with ...
Read more >
string interpolation - format string output - Microsoft Learn
The compiler issues an error if the sequence of brace characters is equal to or greater than double the length of the sequence...
Read more >
Displaying values with interpolation - Angular
Displaying values with interpolationlink​​ Interpolation refers to embedding expressions into marked up text. By default, interpolation uses the double curly ...
Read more >
Chapter 4. Interpolation - TAMU Math
In many texts the values xi, i = 0, 1,..., n are called the nodes. A ... Constructed in this way the interpolating...
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