Skip to main content
# word-embedder

[![travis][travis-image]][travis-url]
[![pypi][pypi-image]][pypi-url]

[travis-image]: https://img.shields.io/travis/Yoctol/word-embedder.svg?style=flat
[travis-url]: https://travis-ci.org/Yoctol/word-embedder
[pypi-image]: https://img.shields.io/pypi/v/word-embedder.svg?style=flat
[pypi-url]: https://pypi.python.org/pypi/word-embedder

Get pretrained word embedding


## Installation

### Requirements
* Linux
* Python 3.6 and up

`$ pip install word-embedder`

## Usage

### Lookup all existed embedders
```python

from word_embedder import lib

lib.list_all_embedders() # returns a list of embedder name

```

### Use an existed embedder

1. load an embedder called OHOH
```python

from word_embedder import lib

name = 'OHOH' # embedder name
embedder = lib[name]

```

2. extract a word vector

- (1) given a word 'juice' (str)
```python

word = 'juice'
embedder[word] # returns the corresponding word vector

# Note: if 'juice' is not in the vocabulary,
# OOVError would be raised.

```

- (2) given an index 3 (int)
```python

index = 3
embedder[index] # returns the corresponding word vector

# Note: if the index is out of range of vocabulary size,
# OOVError would be raised.

```


Release files for word-embedder 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for word-embedder 1.0.0
File Size Uploaded
word-embedder-1.0.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for word-embedder 1.0.0
File Interpreter ABI Platform
word_embedder-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.5 kB

Release files / word-embedder-1.0.0.tar.gz

Download URL word-embedder-1.0.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cc5fa5016fdaa2813debc0265794dd6cd76f9d1e479076c3293679500b901c0c
BLAKE2b-256 checksum
How to use checksums
011e823d3c4e2b88534e0ae686e8d6e31d2c1678a1b58c5162f2158982e0674a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

Release files / word_embedder-1.0.0-py3-none-any.whl

Download URL word_embedder-1.0.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67b406105959ff4aeace8d6aefbc1f0bc7cac63b0dc198ab9d0000a8ae8ed2f1
BLAKE2b-256 checksum
How to use checksums
399c46e19a9ee67d95cca9658eb6c17e010ffa29faa9dc1c00be8001b12c9f11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page