jina.helloworld.helper

jina.helloworld.helper.index_generator(num_docs, target)[source]

Generate the index data.

Parameters
  • num_docs (int) – Number of documents to be indexed.

  • target (dict) – Dictionary which stores the data paths

Yields

index data

jina.helloworld.helper.query_generator(num_docs, target, with_groundtruth=True)[source]

Generate the query data.

Parameters
  • num_docs (int) – Number of documents to be queried

  • target (dict) – Dictionary which stores the data paths

  • with_groundtruth (bool) – True if want to include labels into query data

Yields

query data

jina.helloworld.helper.print_result(resp)[source]

Callback function to receive results.

Parameters

resp – returned response with data

jina.helloworld.helper.write_html(html_path)[source]

Method to present results in browser.

Parameters

html_path – path of the written html

jina.helloworld.helper.download_data(targets, download_proxy=None, task_name='download fashion-mnist')[source]

Download data.

Parameters
  • targets – target path for data.

  • download_proxy – download proxy (e.g. ‘http’, ‘https’)

  • task_name – name of the task

jina.helloworld.helper.load_mnist(path)[source]

Load MNIST data

Parameters

path – path of data

Returns

MNIST data in np.array

jina.helloworld.helper.load_labels(path)[source]

Load labels from path

Parameters

path (str) – path of labels

Returns

labels in np.array