Skip to main content

Filter OCR text from prescriptions to extract drug-related texts

Project description

RxBagExtractor

RxBagExtractor 약봉투 사진을 OCR로 읽은 뒤, 해당 텍스트에서 약물명 관련 텍스트를 추출하는 파이썬 라이브러리입니다. 한글로 작성된 처방전 텍스트 처리에 최적화되어 있습니다.

Features

  • 텍스트 필터링: OCR로 읽은 텍스트에서 사용자가 지정한 정규 표현식에 따라 불필요한 텍스트를 제거합니다.
  • 약물 이름 추출: 주어진 텍스트에서 약물 이름만을 추출하는 기능을 제공합니다.

Installation

pip install RxBagExtractor

Usage

Required Parameter

  • ocr_text: OCR로 읽은 후 얻은 텍스트로, 각 줄이 엔터로 구분된 긴 문자열입니다.

Optional Parameters

  • stopwords_customize: 기본 불용어 리스트 외에 추가적으로 필터링하고 싶은 단어들을 문자열 리스트로 입력할 수 있습니다.
  • patterns_exact_customize: OCR 텍스트의 각 줄에서 정확히 매치되어야 할 정규 표현식을 포함하는 리스트. 각 항목은 re.compile(r"정규표현식") 형식으로 입력됩니다.
  • patterns_include_customize: - CR 텍스트의 각 줄에 이 정규표현식이 포함되어 있으면 해당 줄을 삭제합니다. re.compile(r"정규표현식") 형식으로 입력됩니다.

Example

from RxBagExtractor import extracter

# 약봉투 사진에 대한 OCR 결과 텍스트
ocr_text = "여기에 OCR로 읽은 텍스트 입력"

# Parameter 정의
stopwords_customize = ['유아용', '방문시']
patterns_exact_customize = [re.compile(r"^\d{4}-\d{2}-\d{2}$")]
patterns_include_customize = [re.compile(r"^\d+-\d+-\d+$")]

# 함수 실행
result = extracter(ocr_text, stopwords_customize, patterns_exact_customize, patterns_include_customize)
print(result)

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

RxBagExtractor-0.1.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RxBagExtractor-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file RxBagExtractor-0.1.2.tar.gz.

File metadata

  • Download URL: RxBagExtractor-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for RxBagExtractor-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b823fceabbb1aa8c1ec0f3d6b55ace68f31cc067a7a98256f6b539400fbb262d
MD5 acfc19077f598b488cb3b77b788944bd
BLAKE2b-256 90877dead2471d2c22776389182b5dcd49d64f6216618b65ab685a2f892e355d

See more details on using hashes here.

File details

Details for the file RxBagExtractor-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: RxBagExtractor-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for RxBagExtractor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da8d76397aee7b8bf8878d17ce264336862479cc90d281041ca3caa81b86c86c
MD5 3faffe39d3fbb2bafcbf5a5b32c6ed23
BLAKE2b-256 82bb52109c1d824a3225bfc7c6302806b1f9cae13f8cb64e74c02d557ffed727

See more details on using hashes here.

Supported by

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