Skip to content

Commit

Permalink
Fix Documentation: (#329)
Browse files Browse the repository at this point in the history
Code samples in generate_squad_examples() and df2squad() methods
are referring to incorrect package name. For e.g.

- from cdqa.utils.converter import generate_squad_examples &
from cdqa.utils.converter import df2squad, filter_paragraphs

These have been fixed with the right package name.
  • Loading branch information
rsjain1978 authored and fmikaelian committed Dec 22, 2019
1 parent 5d2e4b3 commit 90acf67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cdqa/utils/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def df2squad(df, squad_version="v1.1", output_dir=None, filename=None):
--------
>>> from ast import literal_eval
>>> import pandas as pd
>>> from cdqa.utils.converter import df2squad, filter_paragraphs
>>> from cdqa.utils.converters import df2squad
>>> from cdqa.utils.filters import filter_paragraphs
>>> df = pd.read_csv('../data/bnpp_newsroom_v1.1/bnpp_newsroom-v1.1.csv', converters={'paragraphs': literal_eval})
>>> df['paragraphs'] = df['paragraphs'].apply(filter_paragraphs)
Expand Down Expand Up @@ -80,7 +81,7 @@ def generate_squad_examples(question, best_idx_scores, metadata, retrieve_by_doc
Examples
--------
>>> from cdqa.utils.converter import generate_squad_examples
>>> from cdqa.utils.converters import generate_squad_examples
>>> squad_examples = generate_squad_examples(question='Since when does the the Excellence Program of BNP Paribas exist?',
best_idx_scores=[(788, 1.2), (408, 0.4), (2419, 0.2)],
metadata=df)
Expand Down

0 comments on commit 90acf67

Please sign in to comment.