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

'\n' mixed in Vocabulary['token'] #111

Open
hehehwang opened this issue Sep 23, 2021 · 3 comments
Open

'\n' mixed in Vocabulary['token'] #111

hehehwang opened this issue Sep 23, 2021 · 3 comments

Comments

@hehehwang
Copy link

it seems that counter in vocabulary is counting 'token' tokens with a newline character.
for example, vocabulary.pkl in java-small dataset, i can find
'return': 6020684,
and
'return\n': 33290,
separately.

i personally fixed this problem by stripping path_context on Vocabulary._process_raw_sample,
but im little confused whether this problem(mixing '\n' in tokens) is intended.

thank you!

@SpirinEgor
Copy link
Contributor

It's interesting. But I'm not sure that this is the same return. The code was tokenized by a parser, so it should handle different indentations. I may suggest that there are different sorts of string literals with return\n inside.

@hehehwang
Copy link
Author

hehehwang commented Oct 3, 2021

i don't understand what "different sorts of string literals with return\n inside." means, but i could find out lots of '*\n' tokens in vocabulary.pkl

for example,
'EMPTY\n': 11459,
'\n': 11416,
'if\n': 6900,
'exception\n': 6624, ...

lots of tokens from 'token' tokens are mixed with '\n', which i assume that vocabulary parser is reading each end of the line

@SpirinEgor
Copy link
Contributor

Yeah, seems strange. I will investigate why the parser extracted tokens with new line characters in the end.

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

2 participants