Skip to content

Conversation

@antmarakis
Copy link
Collaborator

@antmarakis antmarakis commented Jul 16, 2017

Added a new section for languages in nlp.ipynb. I gave a quick overview of context-free grammars and probabilistic cfgs, then I gave an overview of lexicons and grammars and finally gave examples using our implementations.

  • Work on notebook, including an image for tree parsing.

  • Update test_nlp.py; added test for Grammar.

  • Update nlp.py comments.

EDIT: I added generate_random. Even though most of the generated sentences are pretty much gibberish and can be very long, I think it is interesting to see what kind of phrases a very simplistic grammar can generate.

PS: So far in the chapter I have only encountered CFGs (and PCFGs). So even though there are other types of languages, I have refrained from writing on them since the book seems to focus on CFGs. If that is not the case and later on I encounter other grammars, I will amend the relevant section to add the rest of the grammars.

@norvig
Copy link
Collaborator

norvig commented Jul 20, 2017

For now, just CFG and PCFG is good.

@antmarakis
Copy link
Collaborator Author

@norvig: OK great.

@norvig norvig merged commit 7734f8a into aimacode:master Jul 24, 2017
@antmarakis antmarakis deleted the patch-2 branch July 27, 2017 16:52
dj5x5 pushed a commit to dj5x5/aima-python that referenced this pull request Jul 17, 2025
* Update nlp.py

* Update test_nlp.py

* Add files via upload

* Update nlp.ipynb

* add generate_random
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants