Skip to content

Commit 2370608

Browse files
Update 09-wordEmbed_train-word2vec.md
1 parent 1942966 commit 2370608

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

_episodes/09-wordEmbed_train-word2vec.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,28 @@ title: Training Word2Vec
1515

1616
## Colab Setup
1717

18-
Run this code to enable helper functions.
18+
Run this code to enable helper functions and read data back in.
1919

2020

2121
```python
2222
# Run this cell to mount your Google Drive.
2323
from google.colab import drive
2424
drive.mount('/content/drive')
2525

26-
# Set workshop directory
26+
# Show existing colab notebooks and helpers.py file
2727
from os import listdir
28-
wksp_dir = '/content/drive/My Drive/Colab Notebooks/text-analysis'
28+
wksp_dir = '/content/drive/My Drive/Colab Notebooks/text-analysis/code'
29+
print(listdir(wksp_dir))
2930

30-
# Add helper functions to colab's path
31+
# Add folder to colab's path so we can import the helper functions
3132
import sys
32-
helper_path = wksp_dir + '/code'
33-
sys.path.insert(0, helper_path)
33+
sys.path.insert(0, wksp_dir)
3434

35-
# Check that helper directory is correct
36-
listdir(helper_path)
35+
# Read the data back in.
36+
from pandas import read_csv
37+
data = read_csv("/content/drive/My Drive/Colab Notebooks/text-analysis/data/data.csv")
3738
```
39+
3840
~~~
3941
Mounted at /content/drive
4042
['analysis.py',

0 commit comments

Comments
 (0)