colav / impactu

Colav Impactu Issues and Documentation
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Simplifique títulos con mathml de OpenAlex #17

Closed restrepo closed 2 months ago

restrepo commented 3 months ago

Muchos títulos están quedando ilegibles con el mathml de OpenAlex y dificultan la búsqueda por similaridad. Se recomienda procesarlos con el siguiente código antes de procesamientos adicionales: BeautifulSoup(sub(r"([a-zA-Z])<", r"\1 <",text)).text.strip() (ver al final)

Ejemplo:

para ese trabajo la información de título se perdió completamente en la plataforma y no se logró identificar el artículo similar en datos abiertos de minciencias:

Screenshot from 2024-04-03 16-22-31

>>> from bs4 import BeautifulSoup
>>> from re import sub
>>> text=r'Baryonic violation of<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"><mml:mi>R</mml:mi></mml:math>parity from anomalous<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"><mml:mi>U</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mn>1</mml:mn><mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mi>H</mml:mi></mml:msub></mml:math>'
>>> BeautifulSoup(sub(r"([a-zA-Z])<", r"\1 <",text)).text.strip()

'Baryonic violation of R parity from anomalous U (1)H'
omazapa commented 2 months ago

implemented