見出し画像

論文まとめ記事の自動作成(Elsevier API + GPT4)

Twitterで以下のようなツイートが流れてきた.


論文を数本読んで記事を組み立てる→これはAI(GPT4)の得意分野!


ということで実際にやってみる.
システムを簡単にいうとElsevierのAPI*を使ってアブストラクトとタイトルを収集して,それをGPT4**に突っ込む.
*

**

以下はElsevierの論文のアブストラクトを集めるためのコード

 #Elsevierの論文のアブストラクトを集めるためのコード 
import requests  # requestsライブラリをインポートしてWebリクエストを扱えるようにする
import random  # ランダム関数を使えるようにする
import datetime  # 日付・時間関数を使えるようにする

ELSEVIER_API_KEY = ""  # 引用されたAPIキーを格納する変数を定義

HEADERS = {  # APIのリクエストヘッダーを設定する辞書を作成
    'X-ELS-APIKey': ELSEVIER_API_KEY,  # APIキーを指定
    'Accept': 'application/json'  # レスポンスのデータフォーマットをJSONに指定
}

BASE_URL = 'https://api.elsevier.com/content/search/scopus?'  # APIのベースURLを定義
ABSTRACT_BASE_URL = 'https://api.elsevier.com/content/abstract/eid/'  # 抽象データ取得APIのベースURLを定義

def get_abstract(eid):  # 抽象データ取得を行う関数を定義
    abstract_url = f"{ABSTRACT_BASE_URL}{eid}"  # 入力された記事IDを含むURLを作成
    response = requests.get(abstract_url, headers=HEADERS)  # 作成したURLにリクエストを送信し、レスポンスを受け取る
    response.raise_for_status()  # エラーがあれば例外を送出
    abstract_data = response.json()  # 受け取ったレスポンスをJSON形式に変換

    if 'abstracts-retrieval-response' in abstract_data:  # レスポンスに'abstracts-retrieval-response'が存在すれば
        coredata = abstract_data['abstracts-retrieval-response'].get(  # 'coredata'を取得
            'coredata', None)  
        if coredata:  # 'coredata'があれば
            return coredata.get('dc:description', None)  # 'dc:description'を返す

    return None  # 何も返さない

def get_papers(query_arg):  # 検索語を受け取って論文データを取得する関数を定義
    query = f'TITLE-ABS-KEY({query_arg})'  # 検索のクエリ文字列を設定
    print(f"query was set: {query}")  # クエリが設定されたことを印刷

    search_url = f"{BASE_URL}query={query}&count=100&sort=-date&view=STANDARD"  # 検索クエリを含むURLを作成
    response = requests.get(search_url, headers=HEADERS)  # 作成したURLにリクエストを送信し、レスポンスを受け取る
    response.raise_for_status()  # エラーがあれば例外を送出
    search_results = response.json()  # 受け取ったレスポンスをJSON形式に変換

    print("search done")  # 検索が終わったことを印刷

    if 'search-results' in search_results and 'entry' in search_results['search-results']:  # 'search-results'と'entry'が存在すれば
        result_list = search_results['search-results']['entry']  # 'entry'を結果のリストとして取得
    else:
        print("Error: Unexpected API response")  # エラーメッセージを印刷
        result_list = []  # 空のリストを作成

    num_papers = 30  # 取得する論文数を設定
    num_papers = min(num_papers, len(result_list))  # 最小値を選択
    results = random.sample(result_list, k=num_papers)  # ランダムに論文データを抽出
    print("results are ready")  # 結果が準備できたことを印刷

    return results  # 結果を返す

if __name__ == "__main__":  # スクリプトが直接実行された場合のみ
    query_arg = "EEG"  # 検索語を設定
    papers = get_papers(query_arg)  # 検索語を引数にして論文データを取得
    paper_count = 1  # 論文のカウントを開始
    with open('output.txt', 'w') as f:  # テキストファイルを書き込みモードで開く
        for paper in papers:  # 取得した論文データのリストをループ処理
            eid = paper.get('eid', None)  # 論文のeidを取得
            abstract = get_abstract(eid) if eid else None  # eidがあれば抽象を取得
            title = paper['dc:title']  # 論文のタイトルを取得
            if abstract is not None:  # 抽象があれば
                print(  # 論文情報を印刷
                    f"Paper {paper_count}:\nTitle: {title}\nAbstract: {abstract}\n")
                output = f"Paper {paper_count}:\nTitle: {title}\nAbstract: {abstract}\n\n"  # 出力文字列を作成
                print(output)  # 出力文字列を印刷
                f.write(output)  # テキストファイルに書き込む
                paper_count += 1  # 論文カウントをインクリメント

以下のようなプロンプトにして,GPT4に突っ込む.
プロンプトのまとめ方は以下の読書猿さんの記事を参考にした.


以下の論文をまとめる記事を書いてください.記事はタイトルと本文で2000文字以上で構成されます.記事は日本語です.主張を引用したところはAPA方式で論文の番号を振ってください.本文は以下の構成で作られます.構成「1.関連する先行研究にはどんなものがありますか?2.先行研究によって明らかになっていることは,どんなことですか?3.先行研究によって解明されていないことは,どんなことですか?4.新しい研究は,未解明点についてどのような貢献ができますか?5.何を明らかにする研究の一部(ひとつ)ですか?(同種の研究と共通する課題は何ですか?)6. 参考引用文献」『Paper 1:Title: PS-VTS: particle swarm with visit table strategy for automated emotion recognition with EEG signalsAbstract: Recognizing emotions accurately in real life is crucial in human–computer interaction (HCI) systems. Electroencephalogram (EEG) signals have been extensively employed to identify emotions. The researchers have used several EEG-based emotion identification datasets to validate their proposed models. In this paper, we have employed a novel metaheuristic optimization approach for accurate emotion classification by applying it to select both channel and rhythm of EEG data. In this work, we have proposed the particle swarm with visit table strategy (PS-VTS) metaheuristic technique to improve the effectiveness of EEG-based human emotion identification. First, the EEG signals are denoised using a low pass filter, and then rhythm extraction is done using discrete wavelet transform (DWT). The continuous wavelet transform (CWT) approach transforms each rhythm signal into a rhythm image. The pre-trained MobilNetv2 model has been pre-trained for deep feature extraction, and a support vector machine (SVM) is used to classify the emotions. Two models are developed for optimal channels and rhythm sets. In Model 1, optimal channels are selected separately for each rhythm, and global optima are determined in the optimization process according to the best channel sets of the rhythms. The best rhythms are first determined for each channel, and then the optimal channel-rhythm set is selected in Model 2. Our proposed model obtained an accuracy of 99.2871% and 97.8571% for the classification of HA (high arousal)–LA (low arousal) and HV (high valence)–LV (low valence), respectively with the DEAP dataset. Our generated model obtained the highest classification accuracy compared to the previously reported methods.Paper 2:Title: Correlation between the ERD in grasp/open tasks of BCIs and hand function of stroke patients: a cross-sectional studyAbstract: Background and aims: Brain-computer interfaces (BCIs) are emerging as a promising tool for upper limb recovery after stroke, and motor tasks are an essential part of BCIs for patient training and control of rehabilitative/assistive BCIs. However, the correlation between brain activation with different levels of motor impairment and motor tasks in BCIs is still not so clear. Thus, we aim to compare the brain activation of different levels of motor impairment in performing the hand grasping and opening tasks in BCIs. Methods: We instructed stroke patients to perform motor attempts (MA) to grasp and open the affected hand for 30 trials, respectively. During this period, they underwent EEG acquisition and BCIs accuracy recordings. They also received detailed history records and behavioral scale assessments (the Fugl-Meyer assessment of upper limb, FMA-UE). Results: The FMA-UE was negatively correlated with the event-related desynchronization (ERD) of the affected hemisphere during open MA (R = − 0.423, P = 0.009) but not with grasp MA (R = − 0.058, P = 0.733). Then we divided the stroke patients into group 1 (Brunnstrom recovery stages between I to II, n = 19) and group 2 (Brunnstrom recovery stages between III to VI, n = 23). No difference during the grasping task (t = 0.091, P = 0.928), but a significant difference during the open task (t = 2.156, P = 0.037) was found between the two groups on the affected hemisphere. No significant difference was found in the unaffected hemisphere. Conclusions: The study indicated that brain activation is positively correlated with the hand function of stroke in open-hand tasks. In the grasping task, the patients in the different groups have a similar brain response, while in the open task, mildly injured patients have more brain activation in open the hand than the poor hand function patients.Paper 3:Title: Bilateral increase in MEG planar gradients prior to saccade onsetAbstract: Every time we move our eyes, the retinal locations of objects change. To distinguish the changes caused by eye movements from actual external motion of the objects, the visual system is thought to anticipate the consequences of eye movements (saccades). Single neuron recordings have indeed demonstrated changes in receptive fields before saccade onset. Although some EEG studies with human participants have also demonstrated a pre-saccadic increased potential over the hemisphere that will process a stimulus after a saccade, results have been mixed. Here, we used magnetoencephalography to investigate the timing and lateralization of visually evoked planar gradients before saccade onset. We modelled the gradients from trials with both a saccade and a stimulus as the linear combination of the gradients from two conditions with either only a saccade or only a stimulus. We reasoned that any residual gradients in the condition with both a saccade and a stimulus must be uniquely linked to visually-evoked neural activity before a saccade. We observed a widespread increase in residual planar gradients. Interestingly, this increase was bilateral, showing activity both contralateral and ipsilateral to the stimulus, i.e. over the hemisphere that would process the stimulus after saccade offset. This pattern of results is consistent with predictive pre-saccadic changes involving both the current and the future receptive fields involved in processing an attended object, well before the start of the eye movement. The active, sensorimotor coupling of vision and the oculomotor system may underlie the seamless subjective experience of stable and continuous perception.Paper 4:Title: NREM sleep as a novel protective cognitive reserve factor in the face of Alzheimer's disease pathologyAbstract: Background: Alzheimer’s disease (AD) pathology impairs cognitive function. Yet some individuals with high amounts of AD pathology suffer marked memory impairment, while others with the same degree of pathology burden show little impairment. Why is this? One proposed explanation is cognitive reserve i.e., factors that confer resilience against, or compensation for the effects of AD pathology. Deep NREM slow wave sleep (SWS) is recognized to enhance functions of learning and memory in healthy older adults. However, that the quality of NREM SWS (NREM slow wave activity, SWA) represents a novel cognitive reserve factor in older adults with AD pathology, thereby providing compensation against memory dysfunction otherwise caused by high AD pathology burden, remains unknown. Methods: Here, we tested this hypothesis in cognitively normal older adults (N = 62) by combining 11C-PiB (Pittsburgh compound B) positron emission tomography (PET) scanning for the quantification of β-amyloid (Aβ) with sleep electroencephalography (EEG) recordings to quantify NREM SWA and a hippocampal-dependent face-name learning task. Results: We demonstrated that NREM SWA significantly moderates the effect of Aβ status on memory function. Specifically, NREM SWA selectively supported superior memory function in individuals suffering high Aβ burden, i.e., those most in need of cognitive reserve (B = 2.694, p = 0.019). In contrast, those without significant Aβ pathological burden, and thus without the same need for cognitive reserve, did not similarly benefit from the presence of NREM SWA (B = -0.115, p = 0.876). This interaction between NREM SWA and Aβ status predicting memory function was significant after correcting for age, sex, Body Mass Index, gray matter atrophy, and previously identified cognitive reserve factors, such as education and physical activity (p = 0.042). Conclusions: These findings indicate that NREM SWA is a novel cognitive reserve factor providing resilience against the memory impairment otherwise caused by high AD pathology burden. Furthermore, this cognitive reserve function of NREM SWA remained significant when accounting both for covariates, and factors previously linked to resilience, suggesting that sleep might be an independent cognitive reserve resource. Beyond such mechanistic insights are potential therapeutic implications. Unlike many other cognitive reserve factors (e.g., years of education, prior job complexity), sleep is a modifiable factor. As such, it represents an intervention possibility that may aid the preservation of cognitive function in the face of AD pathology, both present moment and longitudinally.Paper 5:Title: Prevalence and pattern of electroencephalographic changes associated with clozapine treatment: a cross-sectional studyAbstract: Background: Clozapine is a second-generation antipsychotic which is known to have superior efficacy as compared to other antipsychotics. It is particularly used in treatment-resistant schizophrenia (10–30%). However, its use is limited due to the serious side effect of inducing seizures which can occur at all doses. The purpose of our study was to analyse patients taking clozapine for any electroencephalographic (EEG) abnormalities. We undertook a cross-sectional study on 107 patients with a different diagnosis taking clozapine who visited the outdoor treatment facility of a tertiary care psychiatric diseases hospital in Kashmir. A 32-channel digital EEG was obtained and evaluated visually for any abnormalities in these patients. The data was tabulated and analysed using SPSS 23.0. Results: EEG abnormalities were reported in 60.75% of patients receiving clozapine out of which slow waves and epileptiform activities were present in 48.60% and 30.84% of patients, respectively. Background slowing was often in the delta and theta ranges. Our study showed that there was a statistically significant relationship between the dose of clozapine and EEG abnormalities. Clinical seizure occurred in only one patient receiving clozapine 450 mg/day and was a smoker who had recently stopped smoking. Conclusions: EEG abnormalities occur frequently in clozapine-treated patients specifically those taking higher doses of clozapine. This calls for utilising EEG as a useful clinical investigation in these patients along with clinical monitoring of seizures especially in those taking higher doses of clozapine in order to hint towards early signs of clozapine toxicity. Caution needs to be taken in patients who are smokers and show a pattern of change in their smoking habits. Moreover, EEG abnormalities though frequently associated with clozapine are not reliable predictors of seizures. Therefore, anticonvulsants may not be routinely indicated in patients on clozapine even in the presence of epileptiform discharges.Paper 6:Title: Compensatory mechanisms of reduced interhemispheric EEG connectivity during sleep in patients with apneaAbstract: We performed a mathematical analysis of functional connectivity in electroencephalography (EEG) of patients with obstructive sleep apnea (OSA) (N = 10; age: 52.8 ± 13 years; median age: 49 years; male/female ratio: 7/3), compared with a group of apparently healthy participants (N = 15; age: 51.5 ± 29.5 years; median age: 42 years; male/female ratio: 8/7), based on the calculation of wavelet bicoherence from nighttime polysomnograms. Having observed the previously known phenomenon of interhemispheric synchronization deterioration, we demonstrated a compensatory increase in intrahemispheric connectivity, as well as a slight increase in the connectivity of the central and occipital areas for high-frequency EEG activity. Significant changes in functional connectivity were extremely stable in groups of apparently healthy participants and OSA patients, maintaining the overall pattern when comparing different recording nights and various sleep stages. The maximum variability of the connectivity was observed at fast oscillatory processes during REM sleep. The possibility of observing some changes in functional connectivity of brain activity in OSA patients in a state of passive wakefulness opens up prospects for further research. Developing the methods of hypnogram evaluation that are independent of functional connectivity may be useful for implementing a medical decision support system.Paper 7:Title: Tfap2b acts in GABAergic neurons to control sleep in miceAbstract: Sleep is a universal state of behavioral quiescence in both vertebrates and invertebrates that is controlled by conserved genes. We previously found that AP2 transcription factors control sleep in C. elegans, Drosophila, and mice. Heterozygous deletion of Tfap2b, one of the mammalian AP2 paralogs, reduces sleep in mice. The cell types and mechanisms through which Tfap2b controls sleep in mammals are, however, not known. In mice, Tfap2b acts during early embryonic stages. In this study, we used RNA-seq to measure the gene expression changes in brains of Tfap2b −/− embryos. Our results indicated that genes related to brain development and patterning were differentially regulated. As many sleep-promoting neurons are known to be GABAergic, we measured the expression of GAD1, GAD2 and Vgat genes in different brain areas of adult Tfap2b +/− mice using qPCR. These experiments suggested that GABAergic genes are downregulated in the cortex, brainstem and cerebellum areas, but upregulated in the striatum. To investigate whether Tfap2b controls sleep through GABAergic neurons, we specifically deleted Tfap2b in GABAergic neurons. We recorded the EEG and EMG before and after a 6-h period of sleep deprivation and extracted the time spent in NREM and in REM sleep as well as delta and theta power to assess NREM and REM sleep, respectively. During baseline conditions, Vgat-tfap2b −/− mice exhibited both shortened NREM and REM sleep time and reduced delta and theta power. Consistently, weaker delta and theta power were observed during rebound sleep in the Vgat-tfap2b −/− mice after sleep deprivation. Taken together, the results indicate that Tfap2b in GABAergic neurons is required for normal sleep.Paper 8:Title: Supervised deep learning with vision transformer predicts delirium using limited lead EEGAbstract: As many as 80% of critically ill patients develop delirium increasing the need for institutionalization and higher morbidity and mortality. Clinicians detect less than 40% of delirium when using a validated screening tool. EEG is the criterion standard but is resource intensive thus not feasible for widespread delirium monitoring. This study evaluated the use of limited-lead rapid-response EEG and supervised deep learning methods with vision transformer to predict delirium. This proof-of-concept study used a prospective design to evaluate use of supervised deep learning with vision transformer and a rapid-response EEG device for predicting delirium in mechanically ventilated critically ill older adults. Fifteen different models were analyzed. Using all available data, the vision transformer models provided 99.9%+ training and 97% testing accuracy across models. Vision transformer with rapid-response EEG is capable of predicting delirium. Such monitoring is feasible in critically ill older adults. Therefore, this method has strong potential for improving the accuracy of delirium detection, providing greater opportunity for individualized interventions. Such an approach may shorten hospital length of stay, increase discharge to home, decrease mortality, and reduce the financial burden associated with delirium.Paper 9:Title: EEG complexity correlates with residual consciousness level of disorders of consciousnessAbstract: Background and objective: Electroencephalography (EEG) and neuroimaging measurements have been highly encouraged to be applied in clinics of disorders of consciousness (DOC) to improve consciousness detection. We tested the relationships between neural complexity measured on EEG and residual consciousness levels in DOC patients. Methods: Resting-state EEG was recorded from twenty-five patients with DOC. Lempel–Ziv complexity (LZC) and permutation Lempel–Ziv complexity (PLZC) were measured on the EEG, and their relationships were analyzed with the consciousness levels of the patients. Results: PLZC and LZC values significantly distinguished patients with a minimally conscious state (MCS), vegetative state/unresponsive wakefulness syndrome (VS/UWS), and healthy controls. PLZC was significantly correlated with the Coma Recovery Scale-Revised (CRS-R) scores of DOC patients in the global brain, particularly in electrodes locating in the anterior and posterior brain regions. Patients with higher CRS-R scores showed higher PLZC values. The significant difference in PLZC values between MCS and VS/UWS was mainly located in the bilateral frontal and right hemisphere regions. Conclusion: Neural complexity measured on EEG correlates with residual consciousness levels of DOC patients. PLZC showed higher sensitivity than LZC in the classification of consciousness levels.Paper 10:Title: Clinical, radiological and electrophysiological predictors for drug-resistant epilepsyAbstract: Background: Epilepsy is the third chronic brain illness worldwide. About a third of the epileptic patients will be drug resistant. Early identification of these patients is critical for appropriate treatment selection and prevention of the devastating consequences of recurrent seizures. The objective of this study aims to detect clinical, electrophysiological, and radiological predictors for drug-resistant epilepsy patients. Results: One hundred fifty-five patients were included in this study, divided into a well-controlled epilepsy group (103 patients) and a drug-resistant group (52 patients). Both groups were compared regarding clinical, electrophysiological, and neuro-radiological data. Younger age at onset, history of delayed milestones, history of perinatal insult (especially hypoxia), mental retardation, neurological deficits, depression, status epilepticus (SE), complex febrile seizures, focal seizure to bilateral tonic–clonic convulsion as well as multiple seizures and high seizure frequency (daily) at onset, poor response to first anti-seizure drug (ASD), structural and metabolic etiology, abnormal brain imaging, and slow background and multifocal epileptiform discharges in EEG were significant risk factors for the development of drug-resistant epilepsy. Conclusion: MRI abnormalities are the most significant predictor for drug-resistant epilepsy. Drug-resistant epilepsy is associated with clinical, electrophysiological, and radiological risk factors that can be used to diagnose drug-resistant patients early and choose the best treatment option and time.』


以下,例としての記事
タイトル:EEGを用いて感情認識や睡眠パターンの解明を目指す最新研究の動向

  1. 関連する先行研究にはどんなものがありますか?
    EEGを用いた感情認識や睡眠パターンの研究はいくつか存在しています。これらの研究では、EEGのデータ解析や統計手法、機械学習アルゴリズムが応用されています(Paper 1, Paper 2, Paper 7, Paper 9)。また、疾患の予測や診断、治療の改善に役立つ情報を提供することを目指した研究もあります(Paper 3, Paper 4, Paper 5, Paper 6, Paper 8, Paper 10)。

  2. 先行研究によって明らかになっていることはどんなことですか?
    先行研究によって明らかにされたことは、EEGデータからの情報抽出や解析手法の改良、アルゴリズムの適用が感情認識や睡眠パターンの解明、予測、また病気の診断や治療の改善に役立つことです。また、複数の異なる要因が感情や睡眠パターンに影響を与えることも明らかにされています。

  3. 先行研究によって解明されていないことは、どんなことですか?
    先行研究によって解明されていないことは、感情認識や睡眠パターンに潜在的に関連するさらなる因子の特定、より効果的なデータ解析手法やアルゴリズムの開発、新しい治療法や診断基準の立案です。また、実際の臨床現場においてこれらの研究成果がどの程度適用可能かについての検証も必要です。

  4. 新しい研究は、未解明点についてどのような貢献ができますか?
    新しい研究によって、感情認識や睡眠パターンの基盤となる神経回路やメカニズムの解明が進むことが期待されます。また、これらの研究成果を活用して、疾患の診断や治療法の改善、さらには個人の感情や睡眠パターンに適応した生活習慣の改善につながる可能性もあります。

  5. 何を明らかにする研究の一部ですか?(同種の研究と共通する課題は何ですか?)
    この研究は、EEGを用いた感情認識や睡眠パターンの解明が目的で、脳波データの解析やアルゴリズムの適用によってこれらの課題にアプローチしています。同種の研究と共通する課題は、EEGデータからの情報抽出や解析手法の改良、アルゴリズムの適用が、感情や睡眠パターン、疾患の診断や治療の改善にどれだけ役立つかを検証することです。

  6. 参考引用文献

  • Paper 1: PS-VTS: particle swarm with visit table strategy for automated emotion recognition with EEG signals

  • Paper 2: Correlation between the ERD in grasp/open tasks of BCIs and hand function of stroke patients: a cross-sectional study

  • Paper 3: Bilateral increase in MEG planar gradients prior to saccade onset

  • Paper 4: NREM sleep as a novel protective cognitive reserve factor in the face of Alzheimer's disease pathology

  • Paper 5: Prevalence and pattern of electroencephalographic changes associated with clozapine treatment: a cross-sectional study

  • Paper 6: Compensatory mechanisms of reduced interhemispheric EEG connectivity during sleep in patients with apnea

  • Paper 7: Tfap2b acts in GABAergic neurons to control sleep in mice

  • Paper 8: Supervised deep learning with vision transformer predicts delirium using limited lead EEG

  • Paper 9: EEG complexity correlates with residual consciousness level of disorders of consciousness

  • Paper 10: Clinical, radiological and electrophysiological predictors for drug-resistant epilepsy


これで記事を自動で投稿するようなプログラムを組めたら面白そう.

この記事が気に入ったらサポートをしてみませんか?