Can't import DB from prodigy

Hello,

I m very new to the prodigy and was following the very first step for an annotation task, and I used ner.manual in order to label the multi words in the pattern that I'm looking for. But at some point when I try to write a custom recipe to extract the annotations to a .jsonl file, I got this error:

terms = DB.get_dataset(dataset)
NameError: name 'DB' is not defined

I tried to download DB in the recipe.py as following :
from prodigy import DB
but it didn't work.

Could you please advice me.

Thanks.

Hi! Check out your PRODIGY_README.html for details on the API, how to initialize the database (and other components) and from where to import stuff.

The database and helpers are located at prodigy.components.db. The connect helper function will connect to your database using the settings in your prodigy.json.

from prodigy.components.db import connect
DB = connect()
# call some database methods here

Thank you Ines.

1 Like