AI Python for begineers: Automating Tasks with Python: Next course preview: working with files

Dear all

I was doing extra practice with the additional text files that are enclosed in the folder journal_entries.

All the files, except the text_file "rio_de_janeiro.txt, seem to work properly after having uploaded each of them in the Python Notebook.

However, the text_file “rio_de_janeiro.txt” seems do not work properly, since it does highligh only the name of the restaurants but not the specialities, althrough the specialities are enclosed in the text.

Please, see below a partial screenshot of the output.

I just wonder to ask whether somebody has an explanation about this. Is perhaps due to an formatting issue of
the specialities in this file?

Thanks in advance.

Hi
It looks like the specialities are also formatted in Italics.
Can you please also share your prompt in order to understand why they may not be highlighted.

Otherwise, you can experiment with the prompt to get your desired result.
For example: Highlight and bold each restaurant
(in orange) and best dish (in blue) within the original text.

1 Like

Thanks a lot for your input.

As you suggested, please see the entire prompt that I used.

However, following your suggestion to change the prompt (e.g. highlight and bold each restaurant (in orange) and best dish (in blue) within the original text seems to work! Please see below the modified prompt