--- title: NLP keywords: fastai sidebar: home_sidebar summary: "API details." description: "API details." ---
%load_ext autoreload
%autoreload 2
%matplotlib inline
# Only needed for testing.
import pandas as pd
from string import ascii_lowercase
# Nonsense sample text.
text = [
f"Row {i}: I went, yesterday; she wasn't here after school? Today. --2"
for i in range(25_000)
]
df = pd.DataFrame(text, columns=['a'])
df.tail()
# ~5-6 seconds
x = df.a.apply(tokenize)
# ~1-2 seconds
x = tokenize_many(df.a)
text = """
Visit ESPN to get up-to-the-minute sports news coverage, scores, highlights and commentary for NFL, MLB, NBA, College Football, NCAA Basketball and more.
"""
back_translate(text, 'es')
text = """
Visit ESPN to get up-to-the-minute sports news coverage, scores, highlights and commentary for NFL, MLB, NBA, College Football, NCAA Basketball and more.
"""
back_translate(text, 'fr')