--- title: NLP keywords: fastai sidebar: home_sidebar summary: "API details." ---
{% raw %}
%load_ext autoreload
%autoreload 2
%matplotlib inline

class Vocabulary[source]

Vocabulary(w2idx, w2vec=None, idx_misc=None, corpus_counts=None, all_lower=True)

back_translate[source]

back_translate(text, to, from_lang='en')

Parameters
----------

Returns
-------
str: Same language and basically the same content as the original text,
    but usually with slightly altered grammar, sentence structure, and/or
    vocabulary.
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')
'Visit ESPN to get coverage of sports news, scores, highlights and comments from the NFL, MLB, NBA, college football, NCAA basketball and more.'
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')
'Visit ESPN for up-to-date sports information, scores, highlights and commentary for the NFL, MLB, NBA, college football, NCAA basketball and more.'
{% endraw %}