Python package for creating labeled examples from wiki dumps
Project description
Wikipedia NER
-------------
Tool to train and obtain named entity recognition labeled examples
from Wikipedia dumps.
Usage in [IPython notebook](http://nbviewer.ipython.org/github/JonathanRaiman/wikipedia_ner/blob/master/Wikipedia%20to%20Named%20Entity%20Recognition.ipynb) (*nbviewer* link).
## Usage
Here is an example usage with the first 200 articles from the english wikipedia dump (dated lated 2013):
parseresult = wikipedia_ner.parse_dump("enwiki.bz2",
max_articles = 200)
most_common_category = wikipedia_ner.ParsedPage.categories_counter.most_common(1)[0][0]
most_common_category_children = [
parseresult.index2target[child] for child in list(wikipedia_ner.ParsedPage.categories[most_common_category].children)
]
"In '%s' the children are %r" % (
most_common_category,
", ".join(most_common_category_children)
)
#=> "In 'Category : Member states of the United Nations' the children are 'Afghanistan, Algeria, Andorra, Antigua and Barbuda, Azerbaijan, Angola, Albania'"
-------------
Tool to train and obtain named entity recognition labeled examples
from Wikipedia dumps.
Usage in [IPython notebook](http://nbviewer.ipython.org/github/JonathanRaiman/wikipedia_ner/blob/master/Wikipedia%20to%20Named%20Entity%20Recognition.ipynb) (*nbviewer* link).
## Usage
Here is an example usage with the first 200 articles from the english wikipedia dump (dated lated 2013):
parseresult = wikipedia_ner.parse_dump("enwiki.bz2",
max_articles = 200)
most_common_category = wikipedia_ner.ParsedPage.categories_counter.most_common(1)[0][0]
most_common_category_children = [
parseresult.index2target[child] for child in list(wikipedia_ner.ParsedPage.categories[most_common_category].children)
]
"In '%s' the children are %r" % (
most_common_category,
", ".join(most_common_category_children)
)
#=> "In 'Category : Member states of the United Nations' the children are 'Afghanistan, Algeria, Andorra, Antigua and Barbuda, Azerbaijan, Angola, Albania'"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wikipedia-ner-0.0.16.tar.gz
(74.8 kB
view details)
File details
Details for the file wikipedia-ner-0.0.16.tar.gz
.
File metadata
- Download URL: wikipedia-ner-0.0.16.tar.gz
- Upload date:
- Size: 74.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f794188dcb22fdeb30d6d9878f2a0449a24918b5d71501d257e566e72e2cbf |
|
MD5 | 8985732fa02831d502ad671506aa71ec |
|
BLAKE2b-256 | 69b9f1f0eafcadf35fae3d51023b2e469860f4dfd3c01ece5124765f5d351478 |