There was Freebase with a community around the project. Sadly Google took it offline and now only use it internally, and prevent others AI projects and competitors like IBM (Watson), Apple (Siri), and Microsoft (Cortana) from using it. So IVM bought Blekko semantic search engine, Apple has now its own web crawler, and Microsoft already bought various SV startups like Powerset to enhance MSN/Live/Bing search.
DBpedia is big as well. WikiData is several magnitudes smaller than Freebase and DBpedia at the moment, but has an active healthy community. What's the best way to run an offline copy of WikiData these days? Does it run on MySQL (or Postgres) like all other Wikimedia properties?
There was Freebase with a community around the project. Sadly Google took it offline
This isn't what happened. Freebase is still available to download and is slowly (with Google support) being migrated to WikiData[1]. There are some other pretty large Knowledge Graphs around. ConceptNet and Probase/MS Concept Graph are two that are worth looking at. [1] https://static.googleusercontent.com/media/research.google.c...
Super super awesome, what a brilliant idea. You might want to do pattern matching such that the answer to the question doesn't match the text of the question. Your example image shows the immediate flaw there.
Excellent idea. There are a lot of interesting ways to improve this, but you have an MVP running, which is a good start.
Regarding your codebase: clear and to-the-point code, well commented, and helpful commit messages. Including a `requirements.txt` is a plus. Good job, keep it up!
Well, I believe that any code should be readable enough so that the comments like below wouldn't be required.
# splits a Wikipedia section into sentences
# and then chunks/tokenizes each sentence If I had interviewed the author, I would have asked him what's the purpose of commenting like that.
I believe it's easier to read a native language than code. I would also counter there is no harm to comments like this so just because you don't find it useful doesn't mean someone else won't.
One of the purposes is to write down what you need to do as comments, and then implement each part. Like pseudo code. Saying you don't have time for it is like saying you don't have time to think through what you're trying to do.
That particular comment seems OK. In general, one should make the code readable to the point of not needing a comment. Comments can rot over time in legacy systems. Somethings really benefit from a comment, however I feel the following snippet is a better example of a comment that should not exist as it does not serve to clarify the code and is just a direct English translation of the simple code:
# Iterate through article's sections
for section in self.page.sections:
The project is cool and I know the code is not necessarily the point. That said, if I were being picky, I'd ask why the author chose not to use docstrings. The code itself is fine but not very Pythonic. There are small inconsistencies* that running pycodestyle [1] once would have caught and could be fixed quickly — I recommend OP consider that.
*Mostly related to: whitespace / spacing, indentation, mixing single quotes and double quotes, magic numbers, naming conventions [1]: https://pypi.python.org/pypi/pycodestyle
I used nltk (natural language toolkit), which takes care of most of the hard work. It tokenizes whatever text you pass it, and even assigns each word a part-of-speech (noun, adjective, etc). The grammar is where I tinkered the most. You can see I have 3 grammar rules set up (NUMBER, LOCATION, PROPER). nltk will go through the tokenized words and see if any sequences of words match any of the rules.If it finds a match it groups/chunks those words together into a phrase with the tag you've specified (ie. LOCATION). As for the rules themselves, they're very easy to write once you understand the syntax. For example, let's look at my PROPER rule, {+} Everything in the {} is the rule.
The tags inside of the <> are the parts-of-speech assigned by nltk. Translating the rule literally would be: match any sequence that has: [an NNP or an NNPS] followed by one or more of [an NNP or an NNPS]. In other words, any sequence of two or more NNP or NNPS words.
Thanks a lot for the explanation. NNP would be Noun-Noun-Phrase and NNPS would be Noun-Noun-Phrase-Sentence I believe? I will play around with the syntax more.
Those interested in this may also be interested in https://en.wikipedia.org/wiki/Incremental_reading which gradually converts reading material into flashcards that are memorized using spaced repetition software.
Comments (85) 24 threads
https://en.wikipedia.org/wiki/DBpedia
DBpedia is big as well.
WikiData is several magnitudes smaller than Freebase and DBpedia at the moment, but has an active healthy community.
What's the best way to run an offline copy of WikiData these days? Does it run on MySQL (or Postgres) like all other Wikimedia properties?
This isn't what happened. Freebase is still available to download and is slowly (with Google support) being migrated to WikiData[1].
There are some other pretty large Knowledge Graphs around. ConceptNet and Probase/MS Concept Graph are two that are worth looking at.
[1] https://static.googleusercontent.com/media/research.google.c...
The supported Virtuoso database is quite esoteric ( https://en.wikipedia.org/wiki/Virtuoso_Universal_Server ).
Has one succeeded writing a script to import the data to Postgres, MySQL or Lucene?
You need a RDF/Graph database (unless you are up for a lot of re-engineering)
I bet you're going to get some offers from making this post on HN. Make sure you have your contact info in your profile. :)
Regarding your codebase: clear and to-the-point code, well commented, and helpful commit messages. Including a `requirements.txt` is a plus.
Good job, keep it up!
# splits a Wikipedia section into sentences # and then chunks/tokenizes each sentence
If I had interviewed the author, I would have asked him what's the purpose of commenting like that.
Continue this thread — 3 replies
Continue this thread — 2 replies
Continue this thread — 1 reply
*Mostly related to: whitespace / spacing, indentation, mixing single quotes and double quotes, magic numbers, naming conventions
[1]: https://pypi.python.org/pypi/pycodestyle
One potential improvement is to remove the common parts of answer and question (as in your Triumph example)
I used nltk (natural language toolkit), which takes care of most of the hard work. It tokenizes whatever text you pass it, and even assigns each word a part-of-speech (noun, adjective, etc).
The grammar is where I tinkered the most. You can see I have 3 grammar rules set up (NUMBER, LOCATION, PROPER). nltk will go through the tokenized words and see if any sequences of words match any of the rules.If it finds a match it groups/chunks those words together into a phrase with the tag you've specified (ie. LOCATION).
As for the rules themselves, they're very easy to write once you understand the syntax. For example, let's look at my PROPER rule, {+}
Everything in the {} is the rule. The tags inside of the <> are the parts-of-speech assigned by nltk. Translating the rule literally would be: match any sequence that has: [an NNP or an NNPS] followed by one or more of [an NNP or an NNPS]. In other words, any sequence of two or more NNP or NNPS words.
Let me know if you plan on continuing it. I'd love to collaborate.
All comments shown.
Couldn't load more comments. Check your connection and try again.