langextract

(★ 38,461)

정밀한 소스 근거 제시(source grounding)와 대화형 시각화를 통해 LLM을 사용하여 비정형 텍스트에서 정형 정보를 추출하는 Python 라이브러리입니다.

파일 탐색기

  • .gitignore
  • .pre-commit-config.yaml
  • .pylintrc
  • autoformat.sh
  • CITATION.cff
  • COMMUNITY_PROVIDERS.md
  • CONTRIBUTING.md
  • Dockerfile
  • LICENSE
  • pyproject.toml
  • README.md
  • tox.ini

# 설치 가이드

python
사전 준비물

설치 및 실행 절차

pip install langextract

파이썬 패키지 관리자를 통해 LangExtract 라이브러리를 설치합니다.

export GEMINI_API_KEY="your_api_key_here"

클라우드 모델 사용을 위해 API 키 환경 변수를 설정합니다.

핵심 명령어

pip install langextract

LangExtract 라이브러리를 설치합니다.

Gemini 또는 OpenAI 등의 클라우드 모델을 사용할 경우 각 제공자의 API 키 설정이 필요합니다.

# CDN으로 사용하기

jsDelivr

jsDelivr는 공개 GitHub 리포지토리를 별도 설정 없이 CDN으로 즉시 서빙합니다. 버전과 파일을 고르면 웹페이지에 바로 붙일 수 있는 링크와 예시 코드가 만들어집니다.

릴리즈 타임라인

활발히 관리 중

명령어 용어집

이 문서에서 사용된 명령어를 모아봤습니다. 낯선 명령어가 있다면 펼쳐서 확인해보세요.

🔍

batch

설명 보기 ▼

이 명령은 `at`의 에일리어스 (별칭) 입니다.
관련 항목: `at`, `atq`, `atrm`, `mail`.
더 많은 정보: <https://manned.org/batch>.

batch

자세한 내용은 원본 명령을 참고하세요:

systemctl start atd

`atd` 데몬 시작:

echo "{{./make_db_backup.sh}}" | batch

Execute a command from `stdin`:

🔍

docker build

설명 보기 ▼

Build an image from a Dockerfile.

docker build .

Build a Docker image using the Dockerfile in the current directory:

docker build {{github.com/creack/docker-firefox}}

Build a Docker image from a Dockerfile at a specified URL:

docker build {{[-t|--tag]}} {{name:tag}} .

Build a Docker image and tag it:

🔍

docker run

설명 보기 ▼

This command is an alias of `docker container run`.

tldr docker container run

View documentation for the original command:

🔍

git clone

설명 보기 ▼

Clone an existing repository.

git clone {{remote_repository_location}} {{path/to/directory}}

Clone an existing repository into a new directory (the default directory is the repository name):

git clone --recursive {{remote_repository_location}}

Clone an existing repository and its submodules:

git clone {{[-n|--no-checkout]}} {{remote_repository_location}}

Clone only the `.git` directory of an existing repository:

🔍

ollama

설명 보기 ▼

대규모 언어 모델 실행기.
사용 가능한 모델 목록은 <https://ollama.com/library>를 참조하세요.
더 많은 정보: <https://docs.ollama.com/cli>.

ollama serve

다른 명령을 실행하는 데 필요한 데몬 시작:

ollama run {{model}}

모델을 실행하고 대화:

ollama run {{model}} --think=false "{{prompt}}"

단일 프롬프트로 모델을 실행하며, thinking 기능을 비활성화:

🔍

pip install

설명 보기 ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

🔍

pre-commit

설명 보기 ▼

커밋 전에 실행되는 Git 훅을 생성.
더 많은 정보: <https://pre-commit.com/#command-line-interface>.

pre-commit install

Git 훅에 pre-commit 설치:

pre-commit run

모든 스테이지된 파일에 pre-commit 훅 실행:

pre-commit run --all-files

스테이지 여부와 상관없이 모든 파일에 pre-commit 훅 실행:

🔍

pylint

설명 보기 ▼

Python 코드 린터.
더 많은 정보: <https://pylint.pycqa.org/en/latest/>.

pylint {{path/to/file.py}}

파일 내 린트 오류 표시:

pylint {{package_or_module}}

패키지 또는 모듈 린트 (import 가능해야 하며, `.py` 접미사 없이):

pylint {{path/to/directory}}

디렉토리 경로에서 패키지 린트 (`__init__.py` 파일이 포함되어 있어야 함):

🔍

pytest

설명 보기 ▼

Python 테스트 실행.
더 많은 정보: <https://docs.pytest.org/en/latest/how-to/usage.html>.

pytest {{path/to/test_file1.py path/to/test_file2.py ...}}

특정 파일에서 테스트 실행:

pytest -k {{expression}}

특정 [k]eyword 표현식과 일치하는 테스트 실행:

pytest {{[-x|--exitfirst]}}

테스트가 실패하거나 오류가 발생하면 즉시 종료:

🔍

python

설명 보기 ▼

Python 언어 인터프리터.
더 많은 정보: <https://docs.python.org/using/cmdline.html>.

python

REPL(대화형 셸) 시작:

python {{path/to/file.py}}

특정 Python 파일 실행:

python -i {{path/to/file.py}}

특정 Python 파일 실행 후 REPL 시작:

🔍

tox

설명 보기 ▼

여러 Python 버전에서 Python 테스트를 자동화.
tox.ini를 사용하여 환경 및 테스트 명령을 구성하세요.
더 많은 정보: <https://github.com/tox-dev/tox>.

tox

모든 테스트 환경에서 테스트 실행:

tox-quickstart

`tox.ini` 구성 생성:

tox {{[-a|--listenvs-all]}}

사용 가능한 환경 나열:

# 프로젝트 배지

// repository documentation