5 ms·
i'd have answered: 1) i would generally not implement that myself -- i like ruby-land's nokigiri for this -- but 2) i can think of some ways how to implement
by cies 15y ago
i'd have answered:
1) i would generally not implement that myself -- i like ruby-land's nokigiri for this -- but
2) i can think of some ways how to implement that if i had (time+incentive) to do so:
2a) - i could use regexps (easy to code)
2b) - i could write a litte parser (potentially much faster)
3) in case you want me to write the algorithm i will pick the regexps for sake of brevity
- joshu 15y agoYou'd have failed, because they aren't talking about HTML entities or whatever.
- drats 15y agoSomeone's down-voted you without explanation, which is rather poor form. Entities in this case means extracting the text of the page - with nokogiri for example, or a variant of readability to get just the article - and then extracting things that are named in that text. I used a modded version of readability and a simple entity extractor in python on the article and got: 'Sudoku', 'Search', 'Google', 'SRE', 'Stanford', 'Freebase', 'OpenCalais', 'SWE', 'Metaweb', 'MIT', 'Wrong', 'HTML', 'Developer Relations', 'Interest', 'DON', 'True', 'CPU'. A great introduction to all this is the O'Reilly book Natural Language Processing with Python (free online[1]). [1]http://www.nltk.org/book http://www.nltk.org/book
- zwily 15y agoI would have assumed they were asking about HTML entities. Like &, etc.
- nostrademons 15y agoA bunch of people assumed that, but it doesn't make sense given Skud's background at Metaweb and her reference to OpenCalais.
- danieldk 15y ago2b) - i could write a litte parser (potentially much faster) Since XML entity references can be described with a regular language, there is an equivalent deterministic finite state acceptor. So, any parser you will write, will probably be slower. Anyway, I think that the interviewer referred to named entity recognition.