|
1 |
| -# Unbox AI | Python SDK |
| 1 | +<div align="left"> |
| 2 | + <img src="https://reference.unbox.ai/_static/unbox.svg"><br> |
| 3 | +</div> |
| 4 | + |
| 5 | +# Unbox AI | Python API Library |
2 | 6 |
|
3 | 7 | [](https://pypi.org/project/Unbox/)
|
4 | 8 | [](https://github.com/psf/black)
|
5 | 9 | [](https://pycqa.github.io/isort/)
|
6 | 10 |
|
7 |
| -## Installation |
| 11 | +## What is it? |
8 | 12 |
|
9 |
| -```console |
10 |
| -pip install -e . |
11 |
| -``` |
| 13 | +Unbox is a debugging workspace for ML & Data Science. Unbox combines and builds upon SOTA techniques in explainability, model and dataset versioning, synthetic data generation, data-centric testing and much more to form a powerful, **unified platform for model development**. |
12 | 14 |
|
13 |
| -## Usage |
| 15 | +👉 [Join our Slack community!](https://l.linklyhq.com/l/1DG73) We'd love to meet you and help you get started with Unbox! |
14 | 16 |
|
15 |
| -```python |
16 |
| -import unboxapi |
| 17 | +This is the official Python library for interacting with the Unbox platform. Navigate [here](https://docs.unbox.ai) for a quickstart guide and for in-depth tutorials. |
17 | 18 |
|
18 |
| -client = unboxapi.UnboxClient('YOUR_API_KEY_HERE') |
19 |
| -``` |
| 19 | +## Main Features |
20 | 20 |
|
21 |
| -## Models |
22 |
| - |
23 |
| -```python |
24 |
| -from unboxapi.models import ModelType |
25 |
| - |
26 |
| -# Predict function |
27 |
| -def predict(model, text_list): |
28 |
| - return model.predict(text_list) |
29 |
| - |
30 |
| -# Package your model and upload it to Unbox |
31 |
| -client.add_model( |
32 |
| - function=predict, |
33 |
| - model=model, |
34 |
| - model_type=ModelType.sklearn, |
35 |
| - class_names=['negative', 'positive'], |
36 |
| - name='My First Model', |
37 |
| - description='Sentiment analyzer for tweets', |
38 |
| - requirements_txt_file='./requirements.txt', |
39 |
| - **kwargs # specify additional kwargs for your predict function |
40 |
| -) |
41 |
| -``` |
| 21 | +This library's primary function is to enable you to easily package your models and datasets and add them to your Unbox account. |
42 | 22 |
|
43 |
| -## Datasets |
44 |
| - |
45 |
| -```python |
46 |
| -# Upload your dataset csv to Unbox |
47 |
| -client.add_dataset( |
48 |
| - file_path='path/to/dataset.csv', |
49 |
| - class_names=['negative', 'positive'], # Notice it matches the model class names |
50 |
| - label_column_name='polarity', |
51 |
| - text_column_name='text', |
52 |
| - name='My First Dataset', |
53 |
| - description='My sentiment analysis validation dataset', |
54 |
| -) |
55 |
| - |
56 |
| -# Alternatively, upload your pandas dataframe to Unbox |
57 |
| -client.add_dataframe( |
58 |
| - df=dataframe, |
59 |
| - class_names=['negative', 'positive'], # Notice it matches the model class names |
60 |
| - label_column_name='polarity', |
61 |
| - text_column_name='text', |
62 |
| - name='My Second Dataset', |
63 |
| - description='My sentiment analysis validation pandas dataframe', |
64 |
| -) |
65 |
| -``` |
66 |
| - |
67 |
| -## Customer Onboarding |
68 |
| - |
69 |
| -When creating a wheel for customers, make sure the following global variables are set as appropriate below: |
| 23 | +## Installation |
70 | 24 |
|
71 |
| -In `__init__.py` |
| 25 | +Install with PyPI (pip) |
72 | 26 |
|
73 |
| -```python |
74 |
| -DEPLOYMENT = DeploymentType.AWS # If using AWS |
75 |
| -DEPLOYMENT = DeploymentType.ONPREM # If using local trial |
| 27 | +```console |
| 28 | +pip install --upgrade unboxapi |
76 | 29 | ```
|
77 | 30 |
|
78 |
| -In `api.py` |
| 31 | +or install with Anaconda (conda) |
79 | 32 |
|
80 |
| -```python |
81 |
| -UNBOX_ENDPOINT = "https://api.unbox.ai/api" # If using AWS |
82 |
| -UNBOX_ENDPOINT = "http://localhost:8080/api" # If using local trial |
| 33 | +```console |
| 34 | +conda install unboxapi --channel conda-forge |
83 | 35 | ```
|
84 | 36 |
|
85 |
| -1. To create a wheel, run: |
| 37 | +## Documentation |
86 | 38 |
|
87 |
| -```bash |
88 |
| -python setup.py bdist_wheel |
89 |
| -``` |
| 39 | +The official documentation for this Python library can be found [here](https://reference.unbox.ai). |
90 | 40 |
|
91 |
| -The file should be here: `./dist/unboxapi-{version}-py3-none-any.whl`. |
| 41 | +## Contributing |
92 | 42 |
|
93 |
| -2. Select appropriate sample notebooks from `examples/` and move them into a new folder. Zip that folder and send it over Slack to customers during onboarding |
| 43 | +All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome! Just send us a message on [Slack](https://l.linklyhq.com/l/1DG73). |
0 commit comments