Skip to main content

Filter OCR text from prescriptions to extract drug-related texts

Project description

PrescriptBagExtractor

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

Features

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

Installation

pip install PrescriptBagExtractor

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 PrescriptBagExtractor 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.1.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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: RxBagExtractor-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f196fc5f5366fbc32cb15a600be5657d0e279c9171e3a088a86763df2f96c0c9
MD5 d4d8b9d1810dad45d47978093f74a9dd
BLAKE2b-256 49db39e16f54ad5b62f5bde6c89a49f55fea2485289cb795c781ea9a38256d32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: RxBagExtractor-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 010b65483e741d3e1f17b824588116ad09ea51f7e2447da67331ec1c8b613941
MD5 93a3ea22eb7e805b9b84c96ed073bd12
BLAKE2b-256 a7d68bf1fd8ce106d9a062de7ae870229cd69c2e4bc7497f2a6ea0a0619a6115

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