Comments (4)
You can remove the tags with a simple sed script, eg.
sed '/^<[^>]*>$/dā
ā
On 23 mag 2016, at 10:22, kylemadigan [email protected] wrote:
Hi ,
I have tried cleaning my document using this: python WikiExtractor.py testfile.xml -o extractedcommand. And I got the following result:
Category:Scientific methodA scientific method is a sequence or collection of processes that are considered characteristic of scientific investigation and the acquisition of new scientific knowledge based upon physical evidence.
Category:Scientific terminology Category:Science and engineering awardsThis category includes all prizes and awards relating to science, engineering, technology, and mathematics.
Scientific criticisms are a body of analysis of scientific methodologies, philosophies, and possible negative roles media and politics play in scientific research. Criticism of science is distinct from the academic positions of antiscience or anti-intellectualism which seek to reject entirely the scientific method. Rather, criticism is made to address and refine problems within the sciences in order to improve science as a whole, and its role in society.
That is with the tags still visible, how do i remove all xml tags using wikiextractor?
I have tried :
python WikiExtractor.py testfile.xml -o --no-templates --escapedoc
but unfortunately it does not work either. Please help me.
Thank you
ā
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
from wikiextractor.
Hi I am not very sure what you mean? Can you be more specific please. Thank you.
from wikiextractor.
Hi @kylemadigan!
You can use the feature I added in the #59 pull request.
Let me know if that work for you.
from wikiextractor.
"""
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
import nltk
from nltk import word_tokenize
from nltk.corpus import stopwords
import re
from nltk.util import ngramstext
from collections import Counter
from nltk.stem import PorterStemmer
from nltk import ngrams
from nltk.probability import FreqDist
soup = BeautifulSoup(open("C:\Users\x\Downloads\wiki_00", encoding="utf8"), "html.parser")
text = soup.get_text()
from wikiextractor.
Related Issues (20)
- Non-textual elements score and mapframe are not filtered out
- How to extract lists pages?
- Option to remove blank pages? HOT 1
- Issues on newer (2023) and older (2019) dumps
- ptwiki-latest error HOT 2
- wikiextractor 3.0.6 not extracting HOT 3
- Why was --keep_tables removed?
- Never finishes and even debug gets stuck in a loop
- Warning: Template Errors HOT 1
- Is Windows supported
- Is Windows 10 supported? HOT 28
- Template errors in article HOT 2
- Add feature to extractPage to also dump the extracted page to json/csv/txt
- [Request for Help] Should I support a template file like `templates.txt` followed the arg `--templates`?
- Bullet points are missing in the final extracted text
- does not extract all wiki
- Parsing seems to exclude some part of the page
- Wikidata Extraction
- How to store a document in a separate txt file instead of a single txt file containing multiple documents
- ValueError: cannot find context for 'fork' & cannot pickle '_io.TextIOWrapper' object HOT 2
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 wikiextractor.