An easier way for social science researchers to use OpenAI-GABRIEL
Project description
Easy-GABRIEL
An easier way for social science researchers to use OpenAI-GABRIEL.
Why Built it?
OpenAI-GABRIEL is cool, but it is a little difficult for researchers who are not familiar with Python, especially when using Non-OpenAI models. Also, as of now, the official project only has a README and a Jupyter file to demonstrate how to use it, lacking a proper documentation. Therefore, I aim to provide a simpler way to use it from the third-part model providers like DeepSeek and so on.
How to Use?
Install
You can use uv or pip install this project:
uv add easy-gabriel
# or, if you do not prefer uv, using pip
pip install easy-gabriel
Use in Python
In order to minimize migration cost, you could refer the following code:
import os
import pandas as pd
from easy_gabriel import EasyGABRIEL, init_gabriel, run_gabriel
gabriel: EasyGABRIEL = init_gabriel(
api_key=os.getenv("DEEPSEEK_API_KEY"),
base_url="https://api.deepseek.com/v1",
model="deepseek-chat",
response="openai", # it is means the model is adapted to OpenAI API format.
)
# Then, all the action is same as the official package.
# For example, if we want to use gabriel.rate
df: pd.DataFrame # your dataset
attributes: dict[str, str] # your attributes config
gabriel_func = gabriel.rate(
df,
column_name="your_col_name",
attributes=attributes,
save_dir="./output",
model="deepseek-chat", # if you are not set model, it would be used by previous setting in init_gabriel()
)
result: pd.DataFrame = run_gabriel(gabriel_func)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_gabriel-0.1.0.tar.gz.
File metadata
- Download URL: easy_gabriel-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
978fb3664725c35cb61562bab1e9528be98d8b8dd90d2e6152040fea3104b26e
|
|
| MD5 |
02e91c38321d5732ba70095b9a3384c6
|
|
| BLAKE2b-256 |
f291d09a1061dc1a84b2ce14442b0d5f3827ace99297cd1ba749f70415a1957a
|
File details
Details for the file easy_gabriel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: easy_gabriel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
964f66b145ab5ed31df8869222545211e470543738843f8d011af6c55ec25798
|
|
| MD5 |
dd8728481245abe6a42c8882ac42f8ce
|
|
| BLAKE2b-256 |
5c1146e76090abddd7af096cd5ee921848a48095bcc80c5d5008521c20e457cb
|