"metadata": {},
"outputs": [],
"source": [
- "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/1.titanic-survivors/titanic.csv"
+ "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/1.titanic-survivors/titanic.csv"
]
},
{
```
```python
-!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/1.titanic-survivors/titanic.csv
+!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/1.titanic-survivors/titanic.csv
```
```python
"metadata": {},
"outputs": [],
"source": [
- "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/le-mort-d-arthur.txt\n",
- "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/odyssey.txt\n",
- "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/pride-and-prejudice.txt\n",
- "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/tale-of-two-cities.txt"
+ "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/le-mort-d-arthur.txt\n",
+ "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/odyssey.txt\n",
+ "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/pride-and-prejudice.txt\n",
+ "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/tale-of-two-cities.txt"
]
},
{
"pprint(generate_text(two_cities_model, max_length=100))"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Generating random text"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We've got all the parts. Let's generate some large pieces of text. Do these have the same style as the originals? Are those styles distinctive enough to tell which model generated which text?\n",
+ "\n",
+ "First we'll load some other books..."
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Generating random text"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "We've got all the parts. Let's generate some large pieces of text. Do these have the same style as the originals? Are those styles distinctive enough to tell which model generated which text?"
+ ",,, then generate some text."
]
},
{
"pprint(generate_text(arthur_model))"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
{
"cell_type": "markdown",
"metadata": {},
```
```python
-!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/le-mort-d-arthur.txt
-!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/odyssey.txt
-!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/pride-and-prejudice.txt
-!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/2.markov-chains/tale-of-two-cities.txt
+!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/le-mort-d-arthur.txt
+!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/odyssey.txt
+!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/pride-and-prejudice.txt
+!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/2.markov-chains/tale-of-two-cities.txt
```
```python jupyter={"outputs_hidden": false}
pprint(generate_text(two_cities_model, max_length=100))
```
+## Generating random text
+
+
+We've got all the parts. Let's generate some large pieces of text. Do these have the same style as the originals? Are those styles distinctive enough to tell which model generated which text?
+
+First we'll load some other books...
+
```python jupyter={"outputs_hidden": false}
odyssey = open('odyssey.txt').read()
odyssey_model = build_model(tokenise(odyssey), tuple_size=3)
len(arthur_model)
```
-## Generating random text
-
-
-We've got all the parts. Let's generate some large pieces of text. Do these have the same style as the originals? Are those styles distinctive enough to tell which model generated which text?
+,,, then generate some text.
```python
pprint(generate_text(odyssey_model))
pprint(generate_text(arthur_model))
```
-```python
-
-```
-
# Merging models
"metadata": {},
"outputs": [],
"source": [
- "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/3.eliza/rules.yaml"
+ "!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/3.eliza/rules.yaml"
]
},
{
We can download some rules to work with. Execute this cell.
```python
-!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-quick-start-ai/main/3.eliza/rules.yaml
+!wget --no-check-certificate https://raw.githubusercontent.com/NeilNjae/ou-click-start-ai/main/3.eliza/rules.yaml
```
You can look at the raw rules file by clicking on the "Files" icon in the left sidebar and choosing the `rules.yaml` entry. You should be alboe to see that the rules follow the structure of a pattern and a set of possible responses.