RIscoper 2.0 is a BERT-based deep learning tool for scanning the RNA biomedical relations in literatures, which recruited over 35,000 sentences manually curated from more than 15,000 biomedical literatures. Benefit from approximately 100,000 annotated named entities, the named entity recognition (NER) and relation extraction (RE) tasks were integrated. Both the online tools and data resources of RIscoper 2.0 are available at http://www.rnainter.org/riscoper.
Conda install*
conda create -n RIscoper python=3.7
conda activate RIscoper
pip install -r requirements.txt
Run in python*
import os
os.mkdir("RIscoper")
Download all files in the github and ensure the file structure is as follow:
├── RIscoper
│ ├── code
│ ├── data
│ └── model_weights
Note: Due to the limit of upload file size in GitHub, complete files in folder model_weights can be obtained at http://www.rnainter.org/riscoper/download.
import os
os.chdir("RIscoper")
sys.path.append(os.getcwd() + r"\\code")
from A5_eval import *
RIscoper 2.0 allows for three types of inputs, including single sentence, multiple sentences and sentences labeled with BIO (Begin, Inside, Outside) tags.
Input:
your_text = "taken together, our data suggest that mir-155 may attenuate the expression of smad2 by directly targeting the 3'utr of smad2."
Result of RE:
predict_single(your_text)[1] # 'RRI'
Result of NER:
NER.recognize(your_text) # [('mir-155', 'rna'), ('smad2', 'rna'), ('smad2', 'rna')]
Input:
data_path = "data/example_sentences.txt"
test_data, _ = load_data3(data_path)
Result of RE:
pred_y_list = t_map(predict_single, test_data)
pred_y_list = np.array([i[1] for i in pred_y_list]) # ['RDI', 'RDI', 'RDI', 'NEG', 'RDI']
Result of NER:
y_pred = t_map(NER.recognize, test_data) # [[('circβ-catenin', 'rna'), ('NSCLC', 'NEG')]]
Input:
data_path = "data/example_BIO.txt"
test_data, _ = load_data(data_path)
Result of RE:
test_data = [" ".join([i[0] for i in j]) for j in test_data]
pred_y_list = t_map(predict_single, test_data)
pred_y_list = np.array([i[1] for i in pred_y_list]) # ['RDI', '', 'RDI', 'RRI', 'RRI']
Result of NER:
y_pred = predict_NER(test_data) # [['b-rna', 'o', 'b-NEG', 'o', ', 'o']]
Both the online tools and data resources of RIscoper 2.0 are available at http://www.rnainter.org/riscoper.
Please don't hesitate to address comments/questions/suggestions regarding this tool to: wangdong79@smu.edu.cn