Skip to content
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

只能英文字符吗,数字可以吗,识别字符在哪里设置 #30

Closed
zhuliqian opened this issue Jan 9, 2019 · 5 comments
Closed

Comments

@zhuliqian
Copy link

No description provided.

@Hubert2102
Copy link

在builders/label_map_builder.py里面,原始默认设置值所有可打印的ASCII字符:
elif config.built_in_set == label_map_pb2.CharacterSet.ALLCASES_SYMBOLS:
character_set = list(string.printable[:-6])
最终得到了character_set:
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\', ']', '^', '_', '`', '{', '|', '}', '~']

@xiaoaoran
Copy link

在builders/label_map_builder.py里面,原始默认设置值所有可打印的ASCII字符:
elif config.built_in_set == label_map_pb2.CharacterSet.ALLCASES_SYMBOLS:
character_set = list(string.printable[:-6])
最终得到了character_set:
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '', ']', '^', '_', '`', '{', '|', '}', '~']

请问如果训练中文的话,怎么修改呢?

@Hubert2102
Copy link

Hubert2102 commented Mar 6, 2019

@xiaoaoran 可以将label映射为index的形式,用数字表示中文,因为core/label_map里面其实也是把字符转换为数字进行训练的

@xiaoaoran
Copy link

@NK-Hubert 你训练过吗,这样子可以吗

@zhuliqian
Copy link
Author

@NK-Hubert 你好,请问只有数字和小数点,具体应该怎么改

@zhuliqian zhuliqian reopened this Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants