【发布时间】:2020-12-06 09:51:03
【问题描述】:
我从维基百科转储中获得如下数据:
' The atomic number or proton number (symbol Z) of a <a href="chemical%20element">chemical element</a> is the number of <a href="proton">proton</a>s found in the <a href="atomic%20nucleus">nucleus</a> of an <a href="atom">atom</a>.'
' It is identical to the <a href="charge%20number">charge number</a> of the nucleus.',
' The atomic number uniquely identifies a chemical element.'
' In an <a href="electric%20charge">uncharged</a> atom, the atomic number is also equal to the number of <a href="electron">electron</a>s.'
我想从这些句子中提取提及(带有超链接的文本跨度)。预期的输出是:
["chemical element", "proton", "nucleus", "atom"]
["charge number"],
[]
["uncharged", "electron"]
我想知道从文本中提取此类信息的最佳方法是什么。谢谢。
【问题讨论】:
-
也分享维基百科页面的链接
-
@YashMakan 这里是这个例子的链接en.wikipedia.org/wiki?curid=673。
标签: python-3.x