



注意:比赛中选手提交的notebook必须满足运行后可在当前目录下生成submission.jsonl文件,否则将影响评分计算。
©️ Copyright 2023 @ Authors
Author:
Mujie Lin 📨 , Yongge Li 📨
Date: 2023-02
共享协议:本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
快速开始:点击上方的 开始连接 按钮,选择 ai4s-cup-metrics:0.3镜像 和c12_m92_1 * NVIDIA V100或更大内存的GPU机型即可开始。
0 加载测试集
挂载本次比赛的bohr 数据集,以及微调后的baseline model。
该notebook阅读页面可下载这两个数据集。
1 微调模型的加载
1.1 依赖库的安装和加载
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com Requirement already satisfied: transformers in /opt/conda/lib/python3.8/site-packages (4.37.2) Requirement already satisfied: datasets in /opt/conda/lib/python3.8/site-packages (2.16.1) Requirement already satisfied: peft in /opt/conda/lib/python3.8/site-packages (0.8.2) Requirement already satisfied: accelerate in /opt/conda/lib/python3.8/site-packages (0.26.1) Requirement already satisfied: bitsandbytes in /opt/conda/lib/python3.8/site-packages (0.42.0) Requirement already satisfied: safetensors in /opt/conda/lib/python3.8/site-packages (0.4.2) Requirement already satisfied: regex!=2019.12.17 in /opt/conda/lib/python3.8/site-packages (from transformers) (2022.3.15) Requirement already satisfied: packaging>=20.0 in /opt/conda/lib/python3.8/site-packages (from transformers) (21.3) Requirement already satisfied: pyyaml>=5.1 in /opt/conda/lib/python3.8/site-packages (from transformers) (6.0) Requirement already satisfied: numpy>=1.17 in /opt/conda/lib/python3.8/site-packages (from transformers) (1.20.3) Requirement already satisfied: huggingface-hub<1.0,>=0.19.3 in /opt/conda/lib/python3.8/site-packages (from transformers) (0.19.4) Requirement already satisfied: tqdm>=4.27 in /opt/conda/lib/python3.8/site-packages (from transformers) (4.64.0) Requirement already satisfied: requests in /opt/conda/lib/python3.8/site-packages (from transformers) (2.31.0) Requirement already satisfied: tokenizers<0.19,>=0.14 in /opt/conda/lib/python3.8/site-packages (from transformers) (0.15.0) Requirement already satisfied: filelock in /opt/conda/lib/python3.8/site-packages (from transformers) (3.6.0) Requirement already satisfied: pandas in /opt/conda/lib/python3.8/site-packages (from datasets) (1.3.5) Requirement already satisfied: xxhash in /opt/conda/lib/python3.8/site-packages (from datasets) (3.4.1) Requirement already satisfied: aiohttp in /opt/conda/lib/python3.8/site-packages (from datasets) (3.9.3) Requirement already satisfied: pyarrow-hotfix in /opt/conda/lib/python3.8/site-packages (from datasets) (0.6) Requirement already satisfied: dill<0.3.8,>=0.3.0 in /opt/conda/lib/python3.8/site-packages (from datasets) (0.3.7) Requirement already satisfied: fsspec[http]<=2023.10.0,>=2023.1.0 in /opt/conda/lib/python3.8/site-packages (from datasets) (2023.10.0) Requirement already satisfied: multiprocess in /opt/conda/lib/python3.8/site-packages (from datasets) (0.70.15) Requirement already satisfied: pyarrow>=8.0.0 in /opt/conda/lib/python3.8/site-packages (from datasets) (15.0.0) Requirement already satisfied: psutil in /opt/conda/lib/python3.8/site-packages (from peft) (5.9.0) Requirement already satisfied: torch>=1.13.0 in /opt/conda/lib/python3.8/site-packages (from peft) (2.2.0) Requirement already satisfied: scipy in /opt/conda/lib/python3.8/site-packages (from bitsandbytes) (1.10.1) Requirement already satisfied: multidict<7.0,>=4.5 in /opt/conda/lib/python3.8/site-packages (from aiohttp->datasets) (6.0.5) Requirement already satisfied: attrs>=17.3.0 in /opt/conda/lib/python3.8/site-packages (from aiohttp->datasets) (23.1.0) Requirement already satisfied: frozenlist>=1.1.1 in /opt/conda/lib/python3.8/site-packages (from aiohttp->datasets) (1.4.1) Requirement already satisfied: yarl<2.0,>=1.0 in /opt/conda/lib/python3.8/site-packages (from aiohttp->datasets) (1.9.4) Requirement already satisfied: async-timeout<5.0,>=4.0 in /opt/conda/lib/python3.8/site-packages (from aiohttp->datasets) (4.0.3) Requirement already satisfied: aiosignal>=1.1.2 in /opt/conda/lib/python3.8/site-packages (from aiohttp->datasets) (1.3.1) Requirement already satisfied: typing-extensions>=3.7.4.3 in /opt/conda/lib/python3.8/site-packages (from huggingface-hub<1.0,>=0.19.3->transformers) (4.8.0) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/lib/python3.8/site-packages (from packaging>=20.0->transformers) (3.0.8) Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.8/site-packages (from requests->transformers) (2023.11.17) Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.8/site-packages (from requests->transformers) (3.3) Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/lib/python3.8/site-packages (from requests->transformers) (2.0.12) Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.8/site-packages (from requests->transformers) (2.0.2) Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (12.1.3.1) Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (12.1.105) Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (11.0.2.54) Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (12.1.105) Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (12.1.0.106) Requirement already satisfied: triton==2.2.0 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (2.2.0) Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (11.4.5.107) Requirement already satisfied: sympy in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (1.12) Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (10.3.2.106) Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (12.1.105) Requirement already satisfied: jinja2 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (3.1.1) Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (8.9.2.26) Requirement already satisfied: networkx in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (2.6.3) Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (12.1.105) Requirement already satisfied: nvidia-nccl-cu12==2.19.3 in /opt/conda/lib/python3.8/site-packages (from torch>=1.13.0->peft) (2.19.3) Requirement already satisfied: nvidia-nvjitlink-cu12 in /opt/conda/lib/python3.8/site-packages (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.13.0->peft) (12.3.101) Requirement already satisfied: MarkupSafe>=2.0 in /opt/conda/lib/python3.8/site-packages (from jinja2->torch>=1.13.0->peft) (2.1.1) Requirement already satisfied: pytz>=2017.3 in /opt/conda/lib/python3.8/site-packages (from pandas->datasets) (2022.1) Requirement already satisfied: python-dateutil>=2.7.3 in /opt/conda/lib/python3.8/site-packages (from pandas->datasets) (2.8.2) Requirement already satisfied: six>=1.5 in /opt/conda/lib/python3.8/site-packages (from python-dateutil>=2.7.3->pandas->datasets) (1.16.0) Requirement already satisfied: mpmath>=0.19 in /opt/conda/lib/python3.8/site-packages (from sympy->torch>=1.13.0->peft) (1.3.0) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
1.2 Merge llama-7b with peft (qlora)
Loading checkpoint shards: 100%|██████████| 2/2 [00:26<00:00, 13.26s/it]
1.3 模型的加载和参数配置
/opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:392: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.1` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:397: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.75` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:407: UserWarning: `do_sample` is set to `False`. However, `top_k` is set to `40` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_k`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. warnings.warn(
2 模型推理
2.1 定义推理的函数
2.2 Define Prompts for Baseline
2.2.1 任务一的prompt:
I need to extract gene-disease relation triplets from a given literature abstract. Each triplet consists of (gene, FUNCTION CHANGE, disease) tuples, where the second element indicates the type of regulation exerted by the gene on the disease, for example: (SHROOM3, LOF, Neural tube defects). The possible types of FUNCTION CHANGE include: LOF (loss of function), GOF (gain of function), REG (general regulatory relationship), and COM (complex functional change). Please return all the relation triplets extracted from the abstract in ternary format (gene, FUNCTION CHANGE, disease). If there are multiple triplets, please write them separated by commas, like: (gene, FUNCTION CHANGE, disease),(gene, FUNCTION CHANGE, disease)... You should just answer this question once, and please ensure that ONLY triplets matching the specified format are returned. Additionally, please add '\n' before your output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! The abstract is as follows---- [abstract].
2.2.2 任务二的prompt:
As a biologist AI, your task is to extract all (compound, disease) relations from the provided literature abstract. Please ONLY provide a list of recognized relations in the following format without additional comments or explanations: (compound 1, disease 1),(compound 2, disease 2),(compound 3, disease 3),..... Please add '\n' before your output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! So, the abstract is as follows---- [abstract].
2.2.3 任务三的prompt:
I have a literature abstract regarding drug-drug interactions (DDIs), and I need help extracting all mentioned DDI triples from it. I would like each triplet with '(' and ')' to be returned in the format: '(DRUG1, interaction type, DRUG2), (DRUG3, effect, DRUG4), (DURG5, mechanism, DRUG6)...' The interaction type can be 'advise', 'effect', or 'mechanism'. Please ensure to identify and extract all possible DDIs mentioned in the abstract, including the names of the drugs and the type of interaction between them. Please add '\n' before each output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! So, here is the abstract text, please start your extraction---- [abstract].
2.3 答案提取
在提取之前,我们先把待提取的submission.jsonl按照task1、task2、task3分别拆分成三个文件。
{1: 'testA_task_1.jsonl', 2: 'testA_task_2.jsonl', 3: 'testA_task_3.jsonl'}
首先,分离出大模型的输出。
其次,对大模型输出的字符串进行标准化操作。对于输出结果是二元组/三元组两种情况,需要分别讨论。
然后,分别定义写入任务1~3的处理结果的函数。
2.4 小规模测试
实测单线程执行一条推理任务时,机器的占用率:
2.4.1 任务一
/opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:392: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.1` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:397: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.75` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:407: UserWarning: `do_sample` is set to `False`. However, `top_k` is set to `40` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_k`. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/utils.py:1413: UserWarning: You are calling .generate() with the `input_ids` being on a device type different than your model's device. `input_ids` is on cpu, whereas the model is on cuda. You may experience unexpected behaviors or slower generation. Please make sure that you have put `input_ids` to the correct device by calling for example input_ids = input_ids.to('cuda') before running `.generate()`. warnings.warn(
"<s> I need to extract gene-disease relation triplets from a given literature abstract. Each triplet consists of (gene, FUNCTION CHANGE, disease) tuples, where the second element indicates the type of regulation exerted by the gene on the disease, for example: (SHROOM3, LOF, Neural tube defects). The possible types of FUNCTION CHANGE include: LOF (loss of function), GOF (gain of function), REG (general regulatory relationship), and COM (complex functional change). Please return all the relation triplets extracted from the abstract in ternary format (gene, FUNCTION CHANGE, disease). If there are multiple triplets, please write them separated by commas, like: (gene, FUNCTION CHANGE, disease),(gene, FUNCTION CHANGE, disease)... You should just answer this question once, and please ensure that ONLY triplets matching the specified format are returned. Additionally, please add '\n' before your output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! The abstract is as follows---- N88S mutation in the BSCL2 gene in a Serbian family with distal hereditary motor neuropathy type V or Silver syndrome. BACKGROUND: Distal hereditary motor neuropathy type V (dHMN-V) and Silver syndrome are rare phenotypically overlapping diseases which can be caused by mutations in the Berardinelli-Seip Congenital Lipodystrophy 2 (BSCL2) gene or Seipin. AIM: To report the first Serbian family with a BSCL2 mutation showing variable expression within the family. PATIENTS AND METHODS: A 55-year-old woman presented with weakness of both hands at the age of 45. At age 47, she noticed distal muscle weakness and atrophy in her legs. Physical examination revealed atrophy and weakness of small hand muscles and mild atrophy and weakness of the lower limbs. There was generalized hyperreflexia with the exception of ankle reflexes which were diminished. Her 25year-old son had only stiffness of both legs at the age of 22. Physical examination revealed only generalized hyporeflexia. The third affected member in this family was her 55year-old cousin who showed a more prominent involvement of leg muscles with mild asymmetrical weakness of hand muscles and no pyramidal tract features. RESULTS: In all three patients sensory nerve conduction velocities (NCV) were normal in all extremities. Compound muscle action potential (CMAP) amplitudes were markedly reduced in all patients. Concentric needle EMG showed evidence of chronic denervation in distal muscles. DNA sequencing of BSCL2 was performed and a heterozygous N88S missense mutation in BSCL2 gene was detected in all three patients. CONCLUSION: This report is further confirmation of phenotypic heterogenity due to the N88S mutation of BSCL2 gene in the same family. The variable expression of the mutation within the family suggests that the BSCL2 gene may play a role in the pathogenesis of dHMN-V and Silver syndrome. (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome)\n'(BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome"
"' before your output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! The abstract is as follows---- N88S mutation in the BSCL2 gene in a Serbian family with distal hereditary motor neuropathy type V or Silver syndrome. BACKGROUND: Distal hereditary motor neuropathy type V (dHMN-V) and Silver syndrome are rare phenotypically overlapping diseases which can be caused by mutations in the Berardinelli-Seip Congenital Lipodystrophy 2 (BSCL2) gene or Seipin. AIM: To report the first Serbian family with a BSCL2 mutation showing variable expression within the family. PATIENTS AND METHODS: A 55-year-old woman presented with weakness of both hands at the age of 45. At age 47, she noticed distal muscle weakness and atrophy in her legs. Physical examination revealed atrophy and weakness of small hand muscles and mild atrophy and weakness of the lower limbs. There was generalized hyperreflexia with the exception of ankle reflexes which were diminished. Her 25year-old son had only stiffness of both legs at the age of 22. Physical examination revealed only generalized hyporeflexia. The third affected member in this family was her 55year-old cousin who showed a more prominent involvement of leg muscles with mild asymmetrical weakness of hand muscles and no pyramidal tract features. RESULTS: In all three patients sensory nerve conduction velocities (NCV) were normal in all extremities. Compound muscle action potential (CMAP) amplitudes were markedly reduced in all patients. Concentric needle EMG showed evidence of chronic denervation in distal muscles. DNA sequencing of BSCL2 was performed and a heterozygous N88S missense mutation in BSCL2 gene was detected in all three patients. CONCLUSION: This report is further confirmation of phenotypic heterogenity due to the N88S mutation of BSCL2 gene in the same family. The variable expression of the mutation within the family suggests that the BSCL2 gene may play a role in the pathogenesis of dHMN-V and Silver syndrome. (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome)\n'(BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrome), (BSCL2, N88S, distal hereditary motor neuropathy type V, Silver syndrom"
这里processed_string为空值的原因是:LLM对该段文本提取出的是四元组、而非三元组。
2.4.2 任务三
"<s> I have a literature abstract regarding drug-drug interactions (DDIs), and I need help extracting all mentioned DDI triples from it. I would like each triplet with '(' and ')' to be returned in the format: '(DRUG1, interaction type, DRUG2), (DRUG3, effect, DRUG4), (DURG5, mechanism, DRUG6)...' The interaction type can be 'advise', 'effect', or 'mechanism'. Please ensure to identify and extract all possible DDIs mentioned in the abstract, including the names of the drugs and the type of interaction between them. Please add '\n' before each output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! So, here is the abstract text, please start your extraction----Isocarboxazid should be administered with caution to patients receiving Antabuse (disulfiram, Wyeth-Ayerst Laboratories). In a single study, rats given high intraperitoneal doses of an MAO inhibitor plus disulfiram experienced severe toxicity, including convulsions and death. Concomitant use of Isocarboxazid and other psychotropic agents is generally not recommended because of possible potentiating effects. This is especially true in patients who may subject themselves to an overdosage of drugs. If combination therapy is needed, careful consideration should be given to the pharmacology of all agents to be used. The monoamine oxidase inhibitory effects of Isocarboxazid may persist for a substantial period after discontinuation of the drug, and this should be borne in mind when another drug is prescribed following Isocarboxazid. To avoid potentiation, the physician wishing to terminate treatment with Isocarboxazid and begin therapy with another agent should allow for an interval of 10 days. (Isocarboxazid, advise, disulfiram), (Isocarboxazid, effect, psychotropic agents), (Isocarboxazid, mechanism, drugs)\n(disulfiram, advise, psychotropic agents), (disulfiram, effect, drugs), (disulfiram, mechanism, psychotropic agents)\n(Isocarboxazid, advise, psychotropic agents), (Isocarboxazid, effect, drugs), (Isocarboxazid, mechanism, psychotropic agents)\n(antidepressant, advise, psychotropic agents), (antidepressant, effect, drugs), (antidepressant, mechanism, psychotropic agents)\n(Isocarboxazid, advise, antidepressant), (Isocarboxazid, effect, drugs), (Isocarboxazid, mechanism, antidepressant)\n(antidepressant, advise, psychotropic agents), (antidepressant, effect, drugs), (antidepressant, mechanism, psychotropic agents)\n(Isocarboxazid, advise,"
"' before each output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! So, here is the abstract text, please start your extraction----Isocarboxazid should be administered with caution to patients receiving Antabuse (disulfiram, Wyeth-Ayerst Laboratories). In a single study, rats given high intraperitoneal doses of an MAO inhibitor plus disulfiram experienced severe toxicity, including convulsions and death. Concomitant use of Isocarboxazid and other psychotropic agents is generally not recommended because of possible potentiating effects. This is especially true in patients who may subject themselves to an overdosage of drugs. If combination therapy is needed, careful consideration should be given to the pharmacology of all agents to be used. The monoamine oxidase inhibitory effects of Isocarboxazid may persist for a substantial period after discontinuation of the drug, and this should be borne in mind when another drug is prescribed following Isocarboxazid. To avoid potentiation, the physician wishing to terminate treatment with Isocarboxazid and begin therapy with another agent should allow for an interval of 10 days. (Isocarboxazid, advise, disulfiram), (Isocarboxazid, effect, psychotropic agents), (Isocarboxazid, mechanism, drugs)\n(disulfiram, advise, psychotropic agents), (disulfiram, effect, drugs), (disulfiram, mechanism, psychotropic agents)\n(Isocarboxazid, advise, psychotropic agents), (Isocarboxazid, effect, drugs), (Isocarboxazid, mechanism, psychotropic agents)\n(antidepressant, advise, psychotropic agents), (antidepressant, effect, drugs), (antidepressant, mechanism, psychotropic agents)\n(Isocarboxazid, advise, antidepressant), (Isocarboxazid, effect, drugs), (Isocarboxazid, mechanism, antidepressant)\n(antidepressant, advise, psychotropic agents), (antidepressant, effect, drugs), (antidepressant, mechanism, psychotropic agents)\n(Isocarboxazid, advise"
(antidepressant, effect, drugs), (disulfiram, effect, drugs), (Isocarboxazid, effect, drugs), (Isocarboxazid, mechanism, drugs), (Isocarboxazid, advise, antidepressant), (Isocarboxazid, mechanism, psychotropic agents), (Isocarboxazid, advise, disulfiram), (disulfiram, advise, psychotropic agents), (Isocarboxazid, effect, psychotropic agents), (disulfiram, mechanism, psychotropic agents), (Isocarboxazid, advise, psychotropic agents), (Isocarboxazid, mechanism, antidepressant), (antidepressant, advise, psychotropic agents), (antidepressant, mechanism, psychotropic agents)
2.4.3 任务二
"<s> As a biologist AI, your task is to extract all (compound, disease) relations from the provided literature abstract. Please ONLY provide a list of recognized relations in the following format without additional comments or explanations: (compound 1, disease 1),(compound 2, disease 2),(compound 3, disease 3),..... Please add '\n' before your output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! So, the abstract is as follows----We report the case of a patient who developed acute hepatitis with extensive hepatocellular necrosis, 7 months after the onset of administration of clotiazepam, a thienodiazepine derivative. Clotiazepam withdrawal was followed by prompt recovery. The administration of several benzodiazepines, chemically related to clotiazepam, did not interfere with recovery and did not induce any relapse of hepatitis. This observation shows that clotiazepam can induce acute hepatitis and suggests that there is no cross hepatotoxicity between clotiazepam and several benzodiazepines. (clotiazepam, hepatitis) (clotiazepam, hepatocellular necrosis) (benzodiazepines, hepatitis) (benzodiazepines, hepatocellular necrosis)\n\n(clotiazepam, hepatitis), (clotiazepam, hepatocellular necrosis), (benzodiazepines, hepatitis), (benzodiazepines, hepatocellular necrosis)</s>"
"' before your output to indicate a new line. If you don't provide the output in the format I requested, I will ask you to answer the question again! So, the abstract is as follows----We report the case of a patient who developed acute hepatitis with extensive hepatocellular necrosis, 7 months after the onset of administration of clotiazepam, a thienodiazepine derivative. Clotiazepam withdrawal was followed by prompt recovery. The administration of several benzodiazepines, chemically related to clotiazepam, did not interfere with recovery and did not induce any relapse of hepatitis. This observation shows that clotiazepam can induce acute hepatitis and suggests that there is no cross hepatotoxicity between clotiazepam and several benzodiazepines. (clotiazepam, hepatitis) (clotiazepam, hepatocellular necrosis) (benzodiazepines, hepatitis) (benzodiazepines, hepatocellular necrosis)\n\n(clotiazepam, hepatitis), (clotiazepam, hepatocellular necrosis), (benzodiazepines, hepatitis), (benzodiazepines, hepatocellular necrosis)"
(benzodiazepines, hepatocellular necrosis), (clotiazepam, hepatitis), (benzodiazepines, hepatitis), (clotiazepam, hepatocellular necrosis)
3 开始运行!
将处理的结果写入submission.jsonl文件中,选择追加模式"a"。
/opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:392: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.1` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:397: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.75` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/configuration_utils.py:407: UserWarning: `do_sample` is set to `False`. However, `top_k` is set to `40` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_k`. warnings.warn( /opt/conda/lib/python3.8/site-packages/transformers/generation/utils.py:1413: UserWarning: You are calling .generate() with the `input_ids` being on a device type different than your model's device. `input_ids` is on cpu, whereas the model is on cuda. You may experience unexpected behaviors or slower generation. Please make sure that you have put `input_ids` to the correct device by calling for example input_ids = input_ids.to('cuda') before running `.generate()`. warnings.warn( task1: 1 outputs are processed. task1: 2 outputs are processed. task1: 3 outputs are processed. task1: 4 outputs are processed. task1: 5 outputs are processed. task1: 6 outputs are processed. task1: 7 outputs are processed. task1: 8 outputs are processed. task1: 9 outputs are processed. task1: 10 outputs are processed. task1: 11 outputs are processed. task1: 12 outputs are processed. task1: 13 outputs are processed. task1: 14 outputs are processed. task1: 15 outputs are processed. task1: 16 outputs are processed. task1: 17 outputs are processed. task1: 18 outputs are processed. task1: 19 outputs are processed. task1: 20 outputs are processed. task1: 21 outputs are processed. task1: 22 outputs are processed. task1: 23 outputs are processed. task1: 24 outputs are processed. task1: 25 outputs are processed.
task2: 1 outputs are processed. task2: 2 outputs are processed. task2: 3 outputs are processed. task2: 4 outputs are processed. task2: 5 outputs are processed. task2: 6 outputs are processed. task2: 7 outputs are processed. task2: 8 outputs are processed. task2: 9 outputs are processed. task2: 10 outputs are processed. task2: 11 outputs are processed. task2: 12 outputs are processed. task2: 13 outputs are processed. task2: 14 outputs are processed. task2: 15 outputs are processed. task2: 16 outputs are processed. task2: 17 outputs are processed. task2: 18 outputs are processed. task2: 19 outputs are processed. task2: 20 outputs are processed. task2: 21 outputs are processed. task2: 22 outputs are processed. task2: 23 outputs are processed. task2: 24 outputs are processed. task2: 25 outputs are processed. task2: 26 outputs are processed. task2: 27 outputs are processed. task2: 28 outputs are processed. task2: 29 outputs are processed. task2: 30 outputs are processed. task2: 31 outputs are processed. task2: 32 outputs are processed. task2: 33 outputs are processed. task2: 34 outputs are processed. task2: 35 outputs are processed. task2: 36 outputs are processed. task2: 37 outputs are processed. task2: 38 outputs are processed. task2: 39 outputs are processed. task2: 40 outputs are processed. task2: 41 outputs are processed. task2: 42 outputs are processed. task2: 43 outputs are processed. task2: 44 outputs are processed. task2: 45 outputs are processed. task2: 46 outputs are processed. task2: 47 outputs are processed. task2: 48 outputs are processed. task2: 49 outputs are processed. task2: 50 outputs are processed. task2: 51 outputs are processed. task2: 52 outputs are processed. task2: 53 outputs are processed. task2: 54 outputs are processed. task2: 55 outputs are processed. task2: 56 outputs are processed. task2: 57 outputs are processed. task2: 58 outputs are processed. task2: 59 outputs are processed. task2: 60 outputs are processed. task2: 61 outputs are processed. task2: 62 outputs are processed. task2: 63 outputs are processed. task2: 64 outputs are processed. task2: 65 outputs are processed. task2: 66 outputs are processed. task2: 67 outputs are processed. task2: 68 outputs are processed. task2: 69 outputs are processed. task2: 70 outputs are processed. task2: 71 outputs are processed. task2: 72 outputs are processed. task2: 73 outputs are processed. task2: 74 outputs are processed. task2: 75 outputs are processed. task2: 76 outputs are processed. task2: 77 outputs are processed. task2: 78 outputs are processed. task2: 79 outputs are processed. task2: 80 outputs are processed. task2: 81 outputs are processed. task2: 82 outputs are processed. task2: 83 outputs are processed. task2: 84 outputs are processed. task2: 85 outputs are processed. task2: 86 outputs are processed. task2: 87 outputs are processed. task2: 88 outputs are processed. task2: 89 outputs are processed. task2: 90 outputs are processed. task2: 91 outputs are processed. task2: 92 outputs are processed. task2: 93 outputs are processed. task2: 94 outputs are processed. task2: 95 outputs are processed. task2: 96 outputs are processed. task2: 97 outputs are processed. task2: 98 outputs are processed. task2: 99 outputs are processed. task2: 100 outputs are processed. task2: 101 outputs are processed. task2: 102 outputs are processed. task2: 103 outputs are processed. task2: 104 outputs are processed. task2: 105 outputs are processed. task2: 106 outputs are processed. task2: 107 outputs are processed. task2: 108 outputs are processed. task2: 109 outputs are processed. task2: 110 outputs are processed. task2: 111 outputs are processed. task2: 112 outputs are processed. task2: 113 outputs are processed. task2: 114 outputs are processed. task2: 115 outputs are processed. task2: 116 outputs are processed. task2: 117 outputs are processed. task2: 118 outputs are processed. task2: 119 outputs are processed. task2: 120 outputs are processed. task2: 121 outputs are processed. task2: 122 outputs are processed. task2: 123 outputs are processed. task2: 124 outputs are processed. task2: 125 outputs are processed. task2: 126 outputs are processed. task2: 127 outputs are processed. task2: 128 outputs are processed. task2: 129 outputs are processed. task2: 130 outputs are processed. task2: 131 outputs are processed. task2: 132 outputs are processed. task2: 133 outputs are processed. task2: 134 outputs are processed. task2: 135 outputs are processed. task2: 136 outputs are processed. task2: 137 outputs are processed. task2: 138 outputs are processed. task2: 139 outputs are processed. task2: 140 outputs are processed. task2: 141 outputs are processed. task2: 142 outputs are processed. task2: 143 outputs are processed. task2: 144 outputs are processed. task2: 145 outputs are processed. task2: 146 outputs are processed. task2: 147 outputs are processed. task2: 148 outputs are processed. task2: 149 outputs are processed. task2: 150 outputs are processed. task2: 151 outputs are processed. task2: 152 outputs are processed. task2: 153 outputs are processed. task2: 154 outputs are processed. task2: 155 outputs are processed. task2: 156 outputs are processed. task2: 157 outputs are processed. task2: 158 outputs are processed. task2: 159 outputs are processed. task2: 160 outputs are processed. task2: 161 outputs are processed. task2: 162 outputs are processed. task2: 163 outputs are processed. task2: 164 outputs are processed. task2: 165 outputs are processed. task2: 166 outputs are processed. task2: 167 outputs are processed. task2: 168 outputs are processed. task2: 169 outputs are processed. task2: 170 outputs are processed. task2: 171 outputs are processed. task2: 172 outputs are processed. task2: 173 outputs are processed. task2: 174 outputs are processed. task2: 175 outputs are processed. task2: 176 outputs are processed. task2: 177 outputs are processed. task2: 178 outputs are processed. task2: 179 outputs are processed. task2: 180 outputs are processed. task2: 181 outputs are processed. task2: 182 outputs are processed. task2: 183 outputs are processed. task2: 184 outputs are processed. task2: 185 outputs are processed. task2: 186 outputs are processed. task2: 187 outputs are processed. task2: 188 outputs are processed. task2: 189 outputs are processed. task2: 190 outputs are processed. task2: 191 outputs are processed. task2: 192 outputs are processed. task2: 193 outputs are processed. task2: 194 outputs are processed. task2: 195 outputs are processed. task2: 196 outputs are processed. task2: 197 outputs are processed. task2: 198 outputs are processed. task2: 199 outputs are processed. task2: 200 outputs are processed. task2: 201 outputs are processed. task2: 202 outputs are processed. task2: 203 outputs are processed. task2: 204 outputs are processed. task2: 205 outputs are processed. task2: 206 outputs are processed. task2: 207 outputs are processed. task2: 208 outputs are processed. task2: 209 outputs are processed. task2: 210 outputs are processed. task2: 211 outputs are processed. task2: 212 outputs are processed. task2: 213 outputs are processed. task2: 214 outputs are processed. task2: 215 outputs are processed. task2: 216 outputs are processed. task2: 217 outputs are processed. task2: 218 outputs are processed. task2: 219 outputs are processed. task2: 220 outputs are processed. task2: 221 outputs are processed. task2: 222 outputs are processed. task2: 223 outputs are processed. task2: 224 outputs are processed. task2: 225 outputs are processed.
task3: 1 outputs are processed. task3: 2 outputs are processed. task3: 3 outputs are processed. task3: 4 outputs are processed. task3: 5 outputs are processed. task3: 6 outputs are processed. task3: 7 outputs are processed. task3: 8 outputs are processed. task3: 9 outputs are processed. task3: 10 outputs are processed. task3: 11 outputs are processed. task3: 12 outputs are processed. task3: 13 outputs are processed. task3: 14 outputs are processed. task3: 15 outputs are processed. task3: 16 outputs are processed. task3: 17 outputs are processed. task3: 18 outputs are processed. task3: 19 outputs are processed. task3: 20 outputs are processed. task3: 21 outputs are processed. task3: 22 outputs are processed. task3: 23 outputs are processed. task3: 24 outputs are processed. task3: 25 outputs are processed. task3: 26 outputs are processed. task3: 27 outputs are processed. task3: 28 outputs are processed. task3: 29 outputs are processed. task3: 30 outputs are processed. task3: 31 outputs are processed. task3: 32 outputs are processed. task3: 33 outputs are processed. task3: 34 outputs are processed. task3: 35 outputs are processed. task3: 36 outputs are processed. task3: 37 outputs are processed. task3: 38 outputs are processed. task3: 39 outputs are processed. task3: 40 outputs are processed. task3: 41 outputs are processed. task3: 42 outputs are processed. task3: 43 outputs are processed. task3: 44 outputs are processed. task3: 45 outputs are processed. task3: 46 outputs are processed. task3: 47 outputs are processed. task3: 48 outputs are processed. task3: 49 outputs are processed. task3: 50 outputs are processed.
注意:必须按照任务一25条、任务二224条、任务三50条的顺序和数量进行合并,否则将影响评分。
注意,提交的文件名必须命名为"submission.jsonl"!







