From ec404e8446c9e7f24918937745c6a8647291f5f2 Mon Sep 17 00:00:00 2001 From: Mabu Manaileng Date: Tue, 4 May 2021 09:54:43 +0200 Subject: [PATCH] fix doc string example in TranslationData (#221) * fix doc string example in TranslationData * Fix docs build Co-authored-by: Jirka Borovec Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Ethan Harris --- flash/text/seq2seq/translation/data.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/flash/text/seq2seq/translation/data.py b/flash/text/seq2seq/translation/data.py index 30b7f22669..ba724c0387 100644 --- a/flash/text/seq2seq/translation/data.py +++ b/flash/text/seq2seq/translation/data.py @@ -64,10 +64,14 @@ def from_files( Examples:: - train_df = pd.read_csv("train_data.csv") - tab_data = TabularData.from_df(train_df, target="fraud", - num_cols=["account_value"], - cat_cols=["account_type"]) + datamodule = TranslationData.from_files( + train_file="data/wmt_en_ro/train.csv", + val_file="data/wmt_en_ro/valid.csv", + test_file="data/wmt_en_ro/test.csv", + input="input", + target="target", + batch_size=1, + ) """ return super().from_files(