Better HN
topnewbestaskshowjobs
Log inSign up

youngprogrammer

246 karma · joined Jan 17, 2015 (11y ago) · 61 submissions

Submissions

31.

Stocks with Outperform Ratings Beat the Market(blog.ayoungprogrammer.com ↗)

119 points · by youngprogrammer · 9y ago · 65 comments

comment 9y ago · link · parent

How to travel like a millionaire? Ask the millionaire

33.

Show HN: Using Python and Pandas to Analyze Price Targets and Ratings(blog.ayoungprogrammer.com ↗)

4 points · by youngprogrammer · 9y ago · discuss

comment 10y ago · link · parent

Demo should be working now. The stanford parser getting dying from running out of memory so I moved it to a another box

comment 10y ago · link · parent

Yes it should be possible! You would need to add the grammar matching rules for those languages though.

comment 10y ago · link · parent

Thanks! Fixed the link.

37.

Show HN: A Natural Language Query Engine Without Machine Learning(blog.ayoungprogrammer.com ↗)

115 points · by youngprogrammer · 10y ago · 21 comments

38.

Show HN: A Natural Language Query Engine Witho Machine Learning(blog.ayoungprogrammer.com ↗)

2 points · by youngprogrammer · 10y ago · discuss

comment 10y ago · link · parent

I would argue that parse tree matching is useful to end users (programmers) who are trying to extract some meaning from a sentence. By matching a parse tree, you can match and extract the contextual information about a sentence, e.g. the subject, action and object. Compare this to the intent matching machine learning approach where you feed a model some sample sentences and manually tag the sentences (e.g. wit.ai). You feed a sentence to this black box and you might get the right intent and context matching but you don't know what's going on and you have no control over the matching. Manually create rules for matching parse trees is a little more work than manually tagging sentences but it allows for more control and transparency over how the matching is done.

comment 10y ago · link · parent

Hey thesoonerdev,

I am the person who posted the blog entry. It's true that I don't know much about how NLP parsing works but I do know how the parse trees are structured. I believe matching parse trees is scalable. The examples in my post were for short imperative commands but it is relatively simple to create rules for more complex sentences. It might not be perfect in every case but I would say for a majority of cases it works well.

I'm glad you were able to understand the blogpost and I agree that the material on tregex is not clear and would be difficult to pick up. I hope the library I wrote will let programers start using the Stanford parsing libraries more easily.

41.

Show HN: A NLP Library for Matching Parse Trees(github.com ↗)

46 points · by youngprogrammer · 10y ago · 12 comments

42.

Natural Language Understanding by Matching Parse Trees(blog.ayoungprogrammer.com ↗)

7 points · by youngprogrammer · 10y ago · discuss

43.

Show HN: Extracting Regions of Interest Using Page Markers(blog.ayoungprogrammer.com ↗)

3 points · by youngprogrammer · 10y ago · discuss

44.

Show HN: Extracting Regions of Interest Using Page Markers(blog.ayoungprogrammer.com ↗)

3 points · by youngprogrammer · 10y ago · discuss

comment 10y ago · link · parent

This is interesting because using only last 2 letters of a name and the position of a's, and throwing away all the other information, you can guess the gender of a name with 80% accuracy.

comment 10y ago · link · parent

> The SSN name data seems almost certainly flawed to a small degree...I.e. It's just hard to believe that there are dozens of boys named Jennifer (and yet, strangely, no boys named Sue!)...but we're talking about infinitesimal rounding errors. The vast, vast majority of names are 99% one way or the other...with a few exceptions such as Leslie...though you can mitigate that by using older years of the SSN database.

I agree that the SSN data has flaws, but I only took names with at least 20 people. But the classification is probably iffy, as some names are classified as male and female.

> So I have to strongly disagree with OP that 80% accuracy is something to be astounded by when it comes to gender classification...

I originally hypothesized, I could reach 90% accuracy, but I could only get up to 82% max. As stated in the blog, 80% is the accuracy of a mammogram detecting cancer in a 40-45 year old woman which is pretty good for 3 features!

> I wonder how much more using Soundex would add to the accuracy? Creating a trained name classifier would be a fun project in service of a tool that could gender classify how masculine or feminine a made-up name sounds like...which would be a slightly useful tool if you were a fantasy fiction writer, though I suppose if you were to be a successful writer, your ear would be trained well enough for he purpose to not delegate it to a computational tool.

This would be very interesting to see!

comment 10y ago · link · parent

For me, this was an exercise in practicing machine learning and I found it very interesting that you could get 80% accuracy with such few features. A look up table works very well, but if a name does not exist in the table, you could possibly use some kind of ML to guess the gender.

comment 10y ago · link · parent

80% is not very good for practical uses (the Gender Classification as a Service on the web most likely use a map of names to probability of gender), but I think it is very good for 3 features.

comment 11y ago · link · parent

> So my basic objection is that you're really calling this reading comprehension, but I don't think anything is actually being "understood"; just parsed. A better title would be as I suggested: simple AI correctly answers reading comprehension questions.

I would argue that my program can understand the relationship between different objects but I agree that it does not understand the meaning of the relationships.

> I couldn't answer a REAL reading-comprehension test about this: I just have no idea what it's REALLY talking about, I don't actually understand it. (Obviously on a syntactic level, it's not hard to parse.) I don't know what over-expression is, I don't know what a kinase is, I don't know what phosphorylation is. I don't understand the text. But if the questions are simple, perhaps I could answer some reading comprehension questions about this by parroting back quotations from it. Syntactically, there's nothing difficult here. I just don't understand it.

I would also argue that you are doing very basic reading comprehension here. You might not know the meaning of individual objects, but you understand that "what is wrong" is "the overlapping substrate specificities of many AGC kinases, it is likely that the over-expression of one member of this kinase subfamily will result in the phosphorylation of substrates that are normally phosphorylated by another AGC kinase". You might not know what that whole phrase means, but you understand that its related to "whats wrong" with "studying the physiological role of AGC kinases by overexpressing the active forms in cells". I agree that my program is unable to do full comprehension in not understanding the meaning of objects and relationships, but it can do very basic comprehension in understanding what the relationships are.

> So I think it's unfair to call sentence parsing real reading comprehension, even if sometimes reading comprehension tests fail to differentiate between the two. You can parse sentences perfectly while understanding nothing.

I did not really call it "real" reading comprehension, but "basic" reading comprehension. But I suppose "basic reading comprehension" is still a little of a stretch. I think the real question here is: how can you really determine if a program can understand something? What does understanding something really mean? It is difficult to define something like this and it seems we need some kind of "Turing test" for understanding.

> I did find your work very interesting, thank you.

Thanks!

comment 11y ago · link · parent

> The essential question is: Can it go from basic reading comprehension to advanced just by adding more rules. Is intelligence simply 10 million rules? If so, how do we go about creating new rules as language evolves? By hard-coding them, as in the example code?

I believe that it can go from basic reading comprehension to more advanced by adding many rules but of course manually adding them is not very feasible or scaleable.

> In my opinion, the fuzzy, statistical methods @davesullivan mentions have a better chance at generalizing (although they may well be augmented by rules-based AI).

I agree that a statistical model would be better since it will be able to handle more complexity. It would be much easier to train the rules from a dataset instead of hard coding all of them and it would be able to adapt to new rules as well. However, I could not find a good data set for the task I wanted.

comment 11y ago · link · parent

> It's a great demo project, and I love seeing these on HN.

Thanks!

> OP - Instead of linking directly to en/Stanford Parser etc, you should get together a list of dependencies people need to run your application. Usually as easy as 'pip install pattern' (for the 'ImportError: No module named en') which is `import pattern.en` :-)

I didn't actually pip install anything for my project, I just downloaded and extracted the Stanford Parser, and Nodebox Linguistics libraries. The setup should be in the readme. I'll try to see if I can find the pip dependencies and update the readme.

comment 11y ago · link · parent

> Bobby picked up the toy. Then he put down the toy.

When we read this sentence, our brains automatically augment additional information based on the verb. However, in this example, my program will fail to answer because my program does not augment any additional information but it can be extended to.

This can be implemented in our program by created a new property for each object called "location". If a verb is location based, we can set the location of the object based on what the verb describes. For example, "the toy"'s location could be "Bobby's hands" after the first sentence based on the verb phrase "pick up". So the program will understand where the toy is and be able to understand queries related to "where".

As you can imagine, implementing this would be very tedious since there are too many cases for all the verbs. My program may not be able to do advanced reading comprehension (reading between lines and augmenting information) but I argue that it can do simple reading comprehension, in that it can understand the relationship between objects. There is still a long way to go before my program is capable of more sophisticated reading comprehension, but in theory, I think my approach seems possible.

comment 11y ago · link · parent

> I was intrigued by the initial transcript, but disappointed that it was edited (lightly). For the question "Why did Mary cheer?" the screenshot showed that the simple AI literally answered "because IT be HER FIRST TIME WINNING". This is correct, but the author edited it into a correct sentence for us.

For some reason, the library I used to get the present tense of "was" is "be". I had a manually fix for this but accidentally removed it when I was cleaning up the code. Sorry if I disappointed you

> I think it is too much to call this "capable of basic reading comprehension". Surely, "simple sentence parser can answer reading comprehension questions" would be more correct?

I would say it is capable of basic reading comprehension because it is attempts to build relationships between different objects although the relationships are weak. When humans do reading comprehension, we do what my program does which is try to parse the sentence and understand the relationships. But brains are also able to augment a lot more information and thus be more flexible with understanding.

> Would you say that 14-line Perl program is capable of basic reading comprehension? I wouldn't!

I would say it is not because it does not understanding the relation between objects; it only understands that sentences starting with "why" should be answered with everything after the string "because". Also, in your program, if there are two instances of "because" in the source, your program will only choose the first one.

54.

A Simple AI Capable of Basic Reading Comprehension(blog.ayoungprogrammer.com ↗)

195 points · by youngprogrammer · 11y ago · 61 comments

55.

A Simple AI Capable of Basic Reading Comprehension(blog.ayoungprogrammer.com ↗)

2 points · by youngprogrammer · 11y ago · discuss

123