Comments (2)
Thank you for your report & code-to-reproduce!
In looking over the code, the more basic problem might be that RE_P1
(for REF
tags) assumes that any />
ends the tag, as if there'd never be any kind of nested tag – but in your example fragments, the <NOWIKI/>
or <BR/>
tags do appear. Your suggested fix seems it would only remedy the problem in the few cases you've seen – while the unexpected nesting of any other tags ending />
risk triggering the same problem.
It looks like the RE_P9
(described as "external links"?) and RE_P10
(math) share a similar assumption that any />
must end of the tag-of-interest, rather than some nested tag, and thus might be susceptible to the same issue.
I think it'd be better to tune those regexes to not assume the absence of all nested tags, but that might risk other side-effects, or require other re-ordering of steps – I'm not sure why the existing regexes work the way they do, and processing HTML or Wikipedia's weird wikitext
format with regexes is an inherently clunky & hard-to-maintain approach.
It might be most robust to move some form of RE_P11
("All other tags") up in the process, but narrowed to leave any specific tags of interest.
from gensim.
Thank you for your report & code-to-reproduce!
In looking over the code, the more basic problem might be that
RE_P1
(forREF
tags) assumes that any/>
ends the tag, as if there'd never be any kind of nested tag – but in your example fragments, the<NOWIKI/>
or<BR/>
tags do appear. Your suggested fix seems it would only remedy the problem in the few cases you've seen – while the unexpected nesting of any other tags ending/>
risk triggering the same problem.It looks like the
RE_P9
(described as "external links"?) andRE_P10
(math) share a similar assumption that any/>
must end of the tag-of-interest, rather than some nested tag, and thus might be susceptible to the same issue.I think it'd be better to tune those regexes to not assume the absence of all nested tags, but that might risk other side-effects, or require other re-ordering of steps – I'm not sure why the existing regexes work the way they do, and processing HTML or Wikipedia's weird
wikitext
format with regexes is an inherently clunky & hard-to-maintain approach.It might be most robust to move some form of
RE_P11
("All other tags") up in the process, but narrowed to leave any specific tags of interest.
Yes, my suggestion is not perfect. Do you have better method for processing HTML or Wikipedia's weird wikitext format without regexes?
from gensim.
Related Issues (20)
- EnsembleLDA with pyLDAvis visualisation
- library stubs are missing HOT 1
- Installation Error: Failed building wheel for gensim HOT 6
- Support for python3.12 HOT 2
- It fails to convert non-ascii characters in Turkish wikipedia dump. HOT 1
- Doc2Vec on Wikipedia articles HOT 1
- SyntaxError: future feature annotations is not defined HOT 4
- How can we fix this issue when i use python 3.6? HOT 2
- Please do not hardcode `libc++` HOT 4
- Where are pre-trained doc2vec model w/ recent version of Gensim
- Where are pre-trained doc2vec model w/ recent version of Gensim? HOT 1
- Out-of-Period Terms in LdaSeqModel
- Gensim broken with SciPy 1.13.0 HOT 12
- The triu function is now removed from scipy module HOT 1
- Wrong parameter information in `gensim.models.keyedvectors.KeyedVectors.save()` docstring.
- Bug on Import gensim HOT 1
- import gensim error. Uses triu function from scipy.linalg which is deprecated HOT 4
- scipy probably not needed in [build-system.requires] table HOT 1
- Not able to install either by pip install or downloading source code HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gensim.