1

Not able to get response of ChatterBot as image/hyper link.

I tried to place html image tag in my training data set i.e., .

Training data set:

image_response_data_set.yml

categories:
- myown
conversations:
- - can you show me smiley image?
  - <img src="example.jpg" alt="Smiley face" height="42" width="42">

As my tag is considering as a string, it won't show me as image.

Can any one help me, how can i train bot to give response as image?

Do I need to use any other format instead of .yml?

Is there any Logic Adapter for that?

Note: I'm doing this using ChatterBot/examples/django_app from github.

1 Answers1

0

I'm not quite certain that the example has anything coded into it to make it render images.

If you change the code $row.text(text); to $row.html(text); in the file examples/django_app/example_app/templates/app.html you might see your image rendered as HTML instead of text.

Gunther
  • 2,474
  • 4
  • 31
  • 45
  • how to load static files in `$row.html(text)`? It is not loading `static files` with `$row.html(text)`. Can you please give an idea? – shaik moeed Jan 17 '19 at 11:24
  • The Django documentation has a very good section on how to load static files: https://docs.djangoproject.com/en/2.1/howto/static-files/ – Gunther Jan 18 '19 at 01:50