You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text content of newspapers seems to be returned as paragraphs separated by two newlines. When doing nlp on this, the tokenizer sometimes thinks a sentence spans across two paragraphs, returning a sentence looking like 'first sentence\n\nsecond sentence', which means this part of the code would concatenate the words sentence and second, returning 'first sentencesecond sentence'. This change is meant to fix that, by replacing any run of multiple spaces or newlines by one space.
Another solution would be to first split on double newlines and processing the content of that separately before concatenating again, but this seemed like it would change the least
Issue by dhgelling
Fri Feb 12 13:22:28 2021
Originally opened as codelucas/newspaper#873
The text content of newspapers seems to be returned as paragraphs separated by two newlines. When doing nlp on this, the tokenizer sometimes thinks a sentence spans across two paragraphs, returning a sentence looking like
'first sentence\n\nsecond sentence'
, which means this part of the code would concatenate the words sentence and second, returning'first sentencesecond sentence'
. This change is meant to fix that, by replacing any run of multiple spaces or newlines by one space.Another solution would be to first split on double newlines and processing the content of that separately before concatenating again, but this seemed like it would change the least
dhgelling included the following code: https://github.com/codelucas/newspaper/pull/873/commits
The text was updated successfully, but these errors were encountered: