Git Product home page Git Product logo

retrieve-and-rank-tuning's Introduction

Retrieve and Rank (and Discovery) Experimental Tuning Scripts

This repository contains helper scripts and examples that demonstrate

  • how to use the Retrieve And Rank and Discovery watson services
  • how to evaluate the quality of retrieval performance with your own data

This is meant for users who might want to use the APIs to manage their services (rather than the GUI tools) for more control or debugging. All interaction between my python code and the services take place using the python client libraries provided by IBM.

For more information about Retrieve And Rank, see the detailed documentation.

For more information about Discovery, see the detailed documentation.

Getting Started

0. Clone the repository

git clone [email protected]:rchaks/retrieve-and-rank-tuning.git

1. Setup Python Environment

  1. Ensure installation of Python3.5 (presumably any Python 3.x version should work, but has only been tested with 3.5)

  2. Install pip

    • If you already have it installed, you might still want to check if you've updated to the latest installation pip install --upgrade pip
  3. (Optional) Install virtualenv and initialize a clean virtualenv:

    • virtualenv {location of virtualenv}
    • source {location of virtualenv}/bin/activate

2. Get Watson Credentials from Bluemix

  1. Ensure that you have a Bluemix account: You will use Bluemix to provision Watson services (even the free-tier user account priviledges should be enough for to try out these scripts)

  2. Depending on which service(s) you wish to try out, provision a Retrieve And Rank and/or Discovery service from bluemix. Alternatively, you can use the cloud foundary tools to provision services using command line utilities.

  3. Edit the config/config.ini file with your credentials for one or more services. Should look something like this:

[RetrieveAndRank]
# Credentials from Bluemix
user=7eeeee-30000-4eee-beee-92313faea
password=QQQQQQQQQy

[Discovery]
user=7eeeee-3012310-4eee-beee-92313faea
password=QQQQQQQ123

Install the library

  1. Install the helper scripts as a python library (along necessary dependencies): pip install -e . from inside the main directory.

  2. If you want to test that the scripts are working as expected, you can also kick off the unit tests by running: py.test tests.

Warning: These unit tests will use your credentials to actually call bluemix. If unit tests are interrupted before completion, they may leave data on 'UnitTest' clusters/collections/rankers around. And the tests take a loooong time to execute on account of having to reach out to the watson services.

Examples

Sample usage of the scripts to do a number of tasks are available in the examples directory as Jupyter notebooks.

You can just view these in github (it has sample output), but if you wish to run them locally, you will need to install additional dependencies: pip install -r requirements-examples.txt

Though the Jupyter notebooks show usage from inside Python, the scripts inside rnr_debug_helpers are also command line friendly. For usage info run: python rnr_debug_helpers/<script_name.py> --help

License

This sample code is licensed under Apache 2.0. Full license text is available in LICENSE.

retrieve-and-rank-tuning's People

Contributors

rchaks avatar

Watchers

Zairah Mustahsan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.