{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from fastai import * # Quick accesss to most common functionality\n", "from fastai.text import * # Quick accesss to NLP functionality\n", "from fastai.docs import * # Access to example data provided with fastai" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Text example" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "An example of creating a language model and then transfering to a classifier." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "PosixPath('../data/imdb_sample')" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "untar_data(IMDB_PATH)\n", "IMDB_PATH" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Open and view the independent and dependent variables:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | 0 | \n", "1 | \n", "
|---|---|---|
| 0 | \n", "0 | \n", "Un-bleeping-believable! Meg Ryan doesn't even ... | \n", "
| 1 | \n", "1 | \n", "This is a extremely well-made film. The acting... | \n", "
| 2 | \n", "0 | \n", "Every once in a long while a movie will come a... | \n", "
| 3 | \n", "1 | \n", "Name just says it all. I watched this movie wi... | \n", "
| 4 | \n", "0 | \n", "This movie succeeds at being one of the most u... | \n", "