langextract
정밀한 소스 근거 제시(source grounding)와 대화형 시각화를 통해 LLM을 사용하여 비정형 텍스트에서 정형 정보를 추출하는 Python 라이브러리입니다.
파일 탐색기
- 1-bug.md
- 2-feature-request.md
- config.yml
- pull_request_template.md
- add-new-checks.sh
- add-size-labels.sh
- revalidate-all-prs.sh
- zenodo_publish.py
- auto-update-pr.yaml
- check-infrastructure-changes.yml
- check-linked-issue.yml
- check-pr-size.yml
- check-pr-up-to-date.yaml
- ci.yaml
- publish.yml
- revalidate-pr.yml
- validate-community-providers.yaml
- validate_pr_template.yaml
- zenodo-publish.yml
- benchmark.py
- config.py
- fuzzy_benchmark.py
- plotting.py
- utils.py
- langextract_concept.gif
- langextract_concept.html
- langextract_concept_still.png
- logo.svg
- medication_entity.gif
- medication_entity_re.gif
- romeo_juliet_basic.gif
- romeo_juliet_full.gif
- batch_api_example.md
- japanese_extraction.md
- longer_text_example.md
- medication_examples.md
- output_schema.md
- __init__.py
- provider.py
- schema.py
- pyproject.toml
- README.md
- test_example_provider.py
- romeo_juliet_extraction.ipynb
- .dockerignore
- demo_ollama.py
- docker-compose.yml
- Dockerfile
- README.md
- __init__.py
- exceptions.py
- inference.py
- README.md
- registry.py
- schema.py
- __init__.py
- base_model.py
- data.py
- debug_utils.py
- exceptions.py
- format_handler.py
- output_schema.py
- schema.py
- tokenizer.py
- types.py
- __init__.py
- gemini.py
- openai.py
- __init__.py
- builtin_registry.py
- gemini.py
- gemini_batch.py
- ollama.py
- openai.py
- openai_batch.py
- patterns.py
- README.md
- router.py
- __init__.py
- annotation.py
- chunking.py
- data.py
- data_lib.py
- exceptions.py
- extraction.py
- factory.py
- inference.py
- io.py
- plugins.py
- progress.py
- prompt_validation.py
- prompting.py
- py.typed
- registry.py
- resolver.py
- schema.py
- tokenizer.py
- visualization.py
- create_provider_plugin.py
- validate_community_providers.py
- basic_extraction.py
- multiple_documents.py
- relationship_extraction.py
- prompt-validation.md
- providers.md
- resolver-params.md
- README.md
- SKILL.md
- .pylintrc
- annotation_test.py
- chunking_test.py
- create_provider_plugin_test.py
- data_lib_test.py
- extract_precedence_test.py
- extract_schema_integration_test.py
- factory_schema_test.py
- factory_test.py
- format_handler_test.py
- fuzzy_alignment_cases_test.py
- gemini_retry_test.py
- inference_test.py
- init_test.py
- io_test.py
- openai_batch_test.py
- progress_test.py
- prompt_validation_test.py
- prompting_test.py
- provider_plugin_test.py
- provider_schema_test.py
- registry_test.py
- resolver_test.py
- schema_test.py
- test_gemini_batch_api.py
- test_kwargs_passthrough.py
- test_live_api.py
- test_ollama_integration.py
- tokenizer_test.py
- visualization_test.py
- .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 라이브러리를 설치합니다.
# CDN으로 사용하기
jsDelivrjsDelivr는 공개 GitHub 리포지토리를 별도 설정 없이 CDN으로 즉시 서빙합니다. 버전과 파일을 고르면 웹페이지에 바로 붙일 수 있는 링크와 예시 코드가 만들어집니다.
릴리즈 타임라인
활발히 관리 중명령어 용어집
이 문서에서 사용된 명령어를 모아봤습니다. 낯선 명령어가 있다면 펼쳐서 확인해보세요.
batch
설명 보기 ▼
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
설명 보기 ▼
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
설명 보기 ▼
docker run
This command is an alias of `docker container run`.
tldr docker container run
View documentation for the original command:
git clone
설명 보기 ▼
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
설명 보기 ▼
ollama
대규모 언어 모델 실행기.
사용 가능한 모델 목록은 <https://ollama.com/library>를 참조하세요.
더 많은 정보: <https://docs.ollama.com/cli>.
ollama serve
다른 명령을 실행하는 데 필요한 데몬 시작:
ollama run {{model}}
모델을 실행하고 대화:
ollama run {{model}} --think=false "{{prompt}}"
단일 프롬프트로 모델을 실행하며, thinking 기능을 비활성화:
pip install
설명 보기 ▼
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
설명 보기 ▼
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
설명 보기 ▼
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
설명 보기 ▼
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
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
설명 보기 ▼
tox
여러 Python 버전에서 Python 테스트를 자동화.
tox.ini를 사용하여 환경 및 테스트 명령을 구성하세요.
더 많은 정보: <https://github.com/tox-dev/tox>.
tox
모든 테스트 환경에서 테스트 실행:
tox-quickstart
`tox.ini` 구성 생성:
tox {{[-a|--listenvs-all]}}
사용 가능한 환경 나열:
