Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"\n",
"* `is_done(self)`: Returns true if the objective of the agent and the environment has been completed\n",
"\n",
"The next two functions must be implemented by each subclasses of `Environment` for the agent to recieve percepts and execute actions \n",
"The next two functions must be implemented by each subclasses of `Environment` for the agent to receive percepts and execute actions \n",
"\n",
"* `percept(self, agent)`: Given an agent, this method returns a list of percepts that the agent sees at the current time\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions knowledge_foil.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
" $$ FoilGain(L,R) = t \\big( \\log_2{\\frac{p_1}{p_1+n_1}} - \\log_2{\\frac{p_0}{p_0+n_0}} \\big) $$\n",
" where: \n",
" \n",
" $p_0: \\text{is the number of possitive bindings of rule R } \\\\ n_0: \\text{is the number of negative bindings of R} \\\\ p_1: \\text{is the is the number of possitive bindings of rule R'}\\\\ n_0: \\text{is the number of negative bindings of R'}\\\\ t: \\text{is the number of possitive bindings of rule R that are still covered after adding literal L to R}$\n",
" $p_0: \\text{is the number of positive bindings of rule R } \\\\ n_0: \\text{is the number of negative bindings of R} \\\\ p_1: \\text{is the is the number of positive bindings of rule R'}\\\\ n_0: \\text{is the number of negative bindings of R'}\\\\ t: \\text{is the number of positive bindings of rule R that are still covered after adding literal L to R}$\n",
" \n",
" - Calculate the extended examples for the chosen literal <font color ='blue'>(function __extend_example()__) </font> <br>\n",
" (the set of examples created by extending example with each possible constant value for each new variable in literal)\n",
Expand Down Expand Up @@ -286,11 +286,11 @@
"\n",
"<span class=\"sd\"> where: </span>\n",
"<span class=\"sd\"> </span>\n",
"<span class=\"sd\"> pre_pos = number of possitive bindings of rule R (=current set of rules)</span>\n",
"<span class=\"sd\"> pre_pos = number of positive bindings of rule R (=current set of rules)</span>\n",
"<span class=\"sd\"> pre_neg = number of negative bindings of rule R </span>\n",
"<span class=\"sd\"> post_pos = number of possitive bindings of rule R&#39; (= R U {l} )</span>\n",
"<span class=\"sd\"> post_pos = number of positive bindings of rule R&#39; (= R U {l} )</span>\n",
"<span class=\"sd\"> post_neg = number of negative bindings of rule R&#39; </span>\n",
"<span class=\"sd\"> T = number of possitive bindings of rule R that are still covered </span>\n",
"<span class=\"sd\"> T = number of positive bindings of rule R that are still covered </span>\n",
"<span class=\"sd\"> after adding literal l </span>\n",
"\n",
"<span class=\"sd\"> &quot;&quot;&quot;</span>\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/chapter22/Parsing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
"source": [
"### Example\n",
"\n",
"Now let's try \"the wumpus is dead\" example. First we need to define the grammer and words in the sentence."
"Now let's try \"the wumpus is dead\" example. First we need to define the grammar and words in the sentence."
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions tests/test_nlp4e.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ def test_subspan():

def test_text_parsing():
words = ["the", "wumpus", "is", "dead"]
grammer = E0
assert astar_search_parsing(words, grammer) == 'S'
assert beam_search_parsing(words, grammer) == 'S'
grammar = E0
assert astar_search_parsing(words, grammar) == 'S'
assert beam_search_parsing(words, grammar) == 'S'
words = ["the", "is", "wupus", "dead"]
assert astar_search_parsing(words, grammer) is False
assert beam_search_parsing(words, grammer) is False
assert astar_search_parsing(words, grammar) is False
assert beam_search_parsing(words, grammar) is False


if __name__ == '__main__':
Expand Down
Loading