Skip to main content

No project description provided

Project description

Example

from mars_text_embedding_sdk_python import EmbeddingSDK, KeyValue

objects = [
    [
        KeyValue(key="hello", value="world"),
        KeyValue(key="hello", value="world"),
        KeyValue(key="you", value="are"),
    ],
    [
        KeyValue(key="you", value="are"),
        KeyValue(key="cool", value="beans"),
        KeyValue(key="cool", value="beans"),
    ]
]

sdk = EmbeddingSDK("http://localhost:4001/graphql")
emb_comp = sdk(objects, dims=300).data
arrs = emb_comp.to_arrays(lambda x: x.mean(axis=0)) # aggregate embeddings to their mean

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mars_text_embedding_sdk_python-0.2.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page