
의료 연구에 대한 지식을 향상시킵니다.
Aitrika (이전 PubGpt )는 의료 논문 내에서 많은 관련 정보를 쉽게 추출 할 수있는 도구입니다.
등!
실행하여 Streamlit 앱으로 Aitrika를 시도 할 수 있습니다.
streamlit run app.py
또는 실행하여 스크립트를 사용할 수 있습니다.
python main.py
모든 것을 설치하려면 uv 필요합니다.
우선, 명령으로 uv 설치하십시오.
python main.py
그런 다음 명령으로 가상 환경을 만듭니다.
uv venv venv_name
가상 환경 활성화 :
source venv_name/bin/activate
의존성 설치 :
uv pip install -r requirements.in
API 키를 설정하려면 키를 env.example 파일에 삽입하여 .env 로 이름을 바꿉니다.
PubMed ID를 전달하여 종이에 대한 정보를 쉽게 얻을 수 있습니다.
from aitrika . engine . aitrika import OnlineAItrika
aitrika_engine = OnlineAItrika ( pubmed_id = pubmed_id )
title = aitrika_engine . get_title ()
print ( title )또는 로컬 PDF를 구문 분석 할 수 있습니다.
from aitrika . engine . aitrika import LocalAItrika
aitrika_engine = LocalAItrika ( pdf_path = pdf_path )
title = aitrika_engine . get_title ()
print ( title ) Breast cancer genes: beyond BRCA1 and BRCA2.
유전자와 질병 사이의 연관성과 같은 다른 정보를 얻을 수 있습니다.
associations = aitrika_engine . get_associations () [
{
"gene": "BRIP1",
"disease": "Breast Neoplasms"
},
{
"gene": "PTEN",
"disease": "Breast Neoplasms"
},
{
"gene": "CHEK2",
"disease": "Breast Neoplasms"
},
]
...
또는 멋진 형식의 데이터 프레임을 얻을 수 있습니다.
associations = aitrika_engine . associations ( dataframe = True ) gene disease
0 BRIP1 Breast Neoplasms
1 PTEN Breast Neoplasms
2 CHEK2 Breast Neoplasms
...
Rag의 힘으로 문서를 쿼리 할 수 있습니다.
## Prepare the documents
documents = generate_documents ( content = abstract )
## Set the LLM
llm = GroqLLM ( documents = documents , api_key = os . getenv ( "GROQ_API_KEY" ))
## Query your document
query = "Is BRCA1 associated with breast cancer?"
print ( llm . query ( query = query )) The provided text suggests that BRCA1 is associated with breast cancer, as it is listed among the high-penetrance genes identified in family linkage studies as responsible for inherited syndromes of breast cancer.
또는 다른 정보를 추출 할 수 있습니다.
results = engine . extract_results ( llm = llm )
print ( results ) ** RESULTS **
- High-penetrance genes - BRCA1, BRCA2, PTEN, TP53 - responsible for inherited syndromes
- Moderate-penetrance genes - CHEK2, ATM, BRIP1, PALB2, RAD51C - associated with moderate BC risk
- Low-penetrance alleles - common alleles - associated with slightly increased or decreased risk of BC
- Current clinical practice - high-penetrance genes - widely used
- Future prospect - all familial breast cancer genes - to be included in genetic test
- Research need - clinical management - of moderate and low-risk variants
Aitrika API를 실행하려면 다음을 수행하십시오.
설치 섹션에 설명 된대로 환경을 설정하고 모든 종속성을 설치했는지 확인하십시오.
다음 명령을 사용하여 API 서버를 실행하십시오.
python api.pyAPI는 http://0.0.0:8000에서 실행되기 시작합니다. 이제 다양한 엔드 포인트를 요청할 수 있습니다.
Curl, Postman 또는 HTTP 클라이언트와 같은 도구를 사용하여 API와 상호 작용할 수 있습니다. 예를 들어:
curl -X POST " http://localhost:8000/abstract " -H " Content-Type: application/json " -d ' {"pubmed_id": 12345678} ' API 문서는 자동으로 생성되어 docs/api-reference/openapi.json 에 저장됩니다. 보다 대화 형 API 탐색 경험을 위해 Swagger UI와 같은 도구와 함께이 파일을 사용할 수 있습니다.
이 프로젝트가 유용하다고 생각되면 지원을 고려하십시오.
이 프로젝트를 비즈니스 또는 상업적 맥락에서 사용하는 경우 저에게 연락하십시오.
컨설팅, 맞춤형 개발 또는 상업용 라이센스를 사용할 수 있습니다.
귀하의 지원은이 프로젝트를 활성화하고 지속적으로 개선하는 데 도움이됩니다. 감사합니다!
Aitrika는 Apache 2.0 라이센스에 따라 라이센스가 부여됩니다. 자세한 내용은 라이센스 파일을 참조하십시오.