flask-ner icon indicating copy to clipboard operation
flask-ner copied to clipboard

Button seems 'inactive'

Open PhilippeDataScienc opened this issue 1 year ago • 1 comments

Hi, Thanks for the video. The code does not return anything when clicking on the Find Named Entities Button. Is there anything missing in the code ?

PhilippeDataScienc avatar Feb 14 '24 14:02 PhilippeDataScienc

Hi Philippe! I just found a fix for this, it might have to do with the CORS error in your browser.

To confirm you have this problem, run app.py in your IDE and try typing something into the textbox. After that, press F12 on your keyboard (for Firefox) and see if you see a red line that says "Cross-Origin Request Blocked".

If so, you have the same problem as me.

To fix it, add these two lines of code

  1. In your import statements, add
from flask_cors import CORS  # Import CORS
  1. After your the app variable is assigned, add this line of code
CORS(app)

Save and run python app.py in your terminal. Hope this helps!

Inspired by this StackOverflow post: https://stackoverflow.com/questions/28461001/python-flask-cors-issue

nicholas-ko-zy avatar Feb 22 '25 04:02 nicholas-ko-zy