21,000개 이상의 엔터프라이즈 NLP 모델을 200개 이상의 언어로 제공하는 johnsnowlabs 엔터프라이즈 NLP 라이브러리 생태계에 오픈 소스 johnsnowlabs 라이브러리를 통해 액세스할 수 있습니다. 24,000개 이상의 모든 모델은 John Snow Labs Model Models Hub에서 확인하세요.

Installation and Setup

pip install johnsnowlabs
엔터프라이즈 기능을 설치하려면 다음을 실행하세요:
# for more details see https://nlp.johnsnowlabs.com/docs/en/jsl/install_licensed_quick
nlp.install()
gpu, cpu, apple_silicon, aarch 기반으로 최적화된 바이너리를 사용하여 쿼리와 문서를 임베딩할 수 있습니다. 기본적으로 cpu 바이너리가 사용됩니다. 세션이 시작되면 GPU 또는 CPU 간 전환을 위해 노트북을 재시작해야 하며, 그렇지 않으면 변경 사항이 적용되지 않습니다.

CPU로 쿼리 임베딩하기:

document = "foo bar"
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert')
output = embedding.embed_query(document)

GPU로 쿼리 임베딩하기:

document = "foo bar"
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','gpu')
output = embedding.embed_query(document)

Apple Silicon(M1, M2 등)으로 쿼리 임베딩하기:

documents = ["foo bar", 'bar foo']
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','apple_silicon')
output = embedding.embed_query(document)

AARCH로 쿼리 임베딩하기:

documents = ["foo bar", 'bar foo']
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','aarch')
output = embedding.embed_query(document)

CPU로 문서 임베딩하기:

documents = ["foo bar", 'bar foo']
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','gpu')
output = embedding.embed_documents(documents)

GPU로 문서 임베딩하기:

documents = ["foo bar", 'bar foo']
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','gpu')
output = embedding.embed_documents(documents)

Apple Silicon(M1, M2 등)으로 문서 임베딩하기:

```python
documents = ["foo bar", 'bar foo']
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','apple_silicon')
output = embedding.embed_documents(documents)

Embed Document with AARCH:

```python
documents = ["foo bar", 'bar foo']
embedding = JohnSnowLabsEmbeddings('embed_sentence.bert','aarch')
output = embedding.embed_documents(documents)
모델은 nlp.load로 로드되고 spark 세션은 내부적으로 nlp.start()로 시작됩니다.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I