-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need help about customize entities of SROIE dataset #26
Comments
Yes, it is possible. The main modification lies in the number of categories and the corresponding mappings. Change the SROIE_CLASS_LIST, TAG_TO_IDX, and TAG_TO_IDX_BIO in |
Thank you very much for your very fast answer. But I did not understand how modify B- or I- tag. Can you modify for me, according to my expand sample
|
And one more question. I have to use entities for training SORIE's entities as following
**or just can I use only box and scripts file without entities **
|
For example, if your entity types are TAG_TO_IDX = {
"O": 0, # Remember to keep the background type (others, or O tag) as the first term
"B-type1": 1,
"B-type2": 2,
"B-type3": 3,
}
TAG_TO_IDX_BIO = {
"O": 0, # Remember to keep the background type (others, or O tag) as the first term
"B-type1": 1,
"I-type1": 2,
"B-type2": 3,
"I-type2": 4,
"B-type3": 5,
"I-type3": 6,
} You may also use the following codes to generate the corresponding mappings: SROIE_CLASS_LIST = ["others", "company", "date", "time", "address", "total", "tax", "sub_total"]
TAG_TO_IDX_ = ["O"]
TAG_TO_IDX_BIO_ = ["O"]
for cls_type in SROIE_CLASS_LIST[1:]:
TAG_TO_IDX_.append(f"B-{cls_type}")
TAG_TO_IDX_BIO_.append(f"B-{cls_type}")
TAG_TO_IDX_BIO_.append(f"I-{cls_type}")
TAG_TO_IDX = {s: i for i, s in enumerate(TAG_TO_IDX_)}
TAG_TO_IDX_BIO = {s: i for i, s in enumerate(TAG_TO_IDX_BIO_)} |
For the training phase, only the latter one is required. The codes directly parse the annotations and generate the corresponding BIO tags. |
I will try. Thank you very much for your support and effort. Have nice days. |
Hello, firstly thank your for support in advance.
I would like to expand SROIE entities by using my own dataset. is it possible? Example: I would like to change as following array
SROIE_CLASS_LIST = ["others", "company", "date", "address", "total"]
SROIE_CLASS_LIST = ["others", "company", "date", "time", "address", "total", "tax", "sub_total"]
etc...The text was updated successfully, but these errors were encountered: