Live data from Hacker News

Ask HN: Natural language processing to identify grammar in a text?

news.ycombinator.com

21–25 of 25 posts

Re: Ask HN: Natural language processing to identify grammar in a text?

#22
Some parser like Spacy can give some tense additional information for verbs. But it's probably not custom enough for what you want.

Maybe you can give GPT-3 a try.

If you want to go the custom route, the easy way but which consume a lot of processing power, is to use a neural network and necessitate a boring dataset phase construction.

You build a dataset corresponding to your problem. And you learn it with the neural network.

For inspiration you can see my colorify browser extension, which uses a neural network to learn at the same time to split sentences, predict POS tags, predict root of the sentence, predict the parse tree which are then used to decorate the webpage.

What I did was just programmatically build a dataset from the spacy parser to build a custom javascript parser which does what I want. If I wanted to add some additional information that Spacy doesn't provide like grammar tenses and features, I can complete my dataset manually and have the network predict all the decorations at the same time, which allows it to not need a lot of samples because the layers are shared.

You can probably build your dataset faster by interacting with your neural network (active learning).

For the model you can start with something simple like a convolution residual network architecture. And later use some transformers when you want to reach state of the art.

Re: Ask HN: Natural language processing to identify grammar in a text?

#23
My IOCCC entry [0] detects English passive constructions. Do not feel discouraged by its looks; it is a solid tool. Since both ioccc.org and its official mirrors (in the same domain) are down now, you can look at its Wayback Machine cache [1].

[0] https://www.ioccc.org/2018/ciura/ [1] https://web.archive.org/web/20200224040340/https://www.ioccc...

Re: Ask HN: Natural language processing to identify grammar in a text?

#25
You should look into the English Resource Grammar:

http://moin.delph-in.net/ErgTop

Online demo:

http://erg.delph-in.net/logon

It has all that information in the generated feature structure -- even more than you can view in the web interface. There's a development environment you can download, as well as a headless linux tool called ACE you can use on a server. The ERG is complex, but far and away the most sophisticated tool in this space.

Post reply on HN