textrank icon indicating copy to clipboard operation
textrank copied to clipboard

Why deacc?

Open emillundhcodemill opened this issue 6 years ago • 3 comments

I see that the parameter deacc is set to True for all languages when tokenize is called from clean_text_by_word and tokenize_by_word. This means that in Nordic languages, characters with umlaut like å, ä, ö are rendered without umlaut as a, a, o; this drastically reduces the quality of the keyword extraction for Swedish which makes heavy use of umlauts and where the umlauted characters count as characters in their own right (For example snö=snow, sno=twist; äga=own, aga=spank). AFAICS, it's easy to set deacc=False and obtain much nicer results for Swedish; it should probably be done on a per-language basis (I suggest False for danish, finnish, german, norwegian, and swedish). I'll be happy to file a PR but I'd like to hear if you have any comments?

emillundhcodemill avatar Feb 01 '18 09:02 emillundhcodemill

Hey @emillundhcodemill, thanks for your contributions!

I actually don't recall why the deaccent is always set to true. In our mother tongue (Spanish) few words can be written with or without the accent (solo, for instance). In most cases, though, the accent mark is used consistently to show intonation or to differentiate meaning between one syllable words that are spelled the same.

I would suggest to default deacc to False in all cases and to make it a parameter in the keywords method. What do you think @fedelopez77?

fbarrios avatar Feb 02 '18 22:02 fbarrios

I totally agree with @fbarrios. Honestly we don't remember why we left that with True.

@emillundhcodemill if you could just set it to False by default, and add it as an optional parameter in the keywords method, we would be more than happy to merge your contribution.

Thanks in advance!

fedelopez77 avatar Feb 03 '18 14:02 fedelopez77

OK, done. https://github.com/summanlp/textrank/pull/22

emillundhcodemill avatar Feb 06 '18 10:02 emillundhcodemill