
医学研究の知識を強化します。
Aitrika(以前のPUBGPT )は、医療論文内で多くの関連情報を簡単な方法で抽出できるツールです。
等々!
実行することで、retrylitアプリを使用してAitrikaを試すことができます。
streamlit run app.py
または、実行してスクリプトを使用できます。
python main.py
すべてをインストールするには、 uv必要です。
まず、コマンドにuvをインストールします。
python main.py
その後、コマンドを使用して仮想環境を作成します。
uv venv venv_name
仮想envをアクティブにします:
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.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に保存されます。このファイルをSwagger UIなどのツールで使用して、よりインタラクティブなAPI探索エクスペリエンスを使用できます。
このプロジェクトが役立つ場合は、サポートを検討してください。
このプロジェクトをビジネスまたは商業コンテキストで使用している場合は、私に連絡してください。
コンサルティング、カスタム開発、または商業ライセンスを利用できます。
あなたのサポートは、このプロジェクトを活性化し、継続的に改善し続けるのに役立ちます。ありがとう!
Aitrikaは、Apache 2.0ライセンスに基づいてライセンスされています。詳細については、ライセンスファイルを参照してください。