pubmad.types
View Source
0from datetime import datetime 1from typing import Optional, List 2from dataclasses import dataclass 3 4@dataclass 5class Article: 6 title: str 7 abstract: Optional[str] 8 full_text: Optional[str] 9 pmid: str 10 publication_data: datetime 11 12 13class Entity: 14 ''' 15 Entity defines a gene or a disease in a text. 16 17 Parameters 18 19 mesh_id (List[str]): List of Unique identifier for the entity, e.g. MESH:D001234. (You can use the MESH ID to look up the name of the entity in the MESH database.) 20 mention (str): The string that is associated with the entity in the text (e.g. "BRCA1"). 21 type (str): The type of the entity. Can be 'gene' or 'disease'. 22 prob (float): The probability of the entity, it indicates the confidence of the model prediction. 23 span_begin (int): The begin of the span of the entity. 24 span_end (int): The end of the span of the entity. 25 article (Article): The article the entity is associated with. 26 source (str): The source of the entity within the article. Can be 'abstract' or 'full_text'. Defaults to 'abstract'. 27 pmid (str): The PubMed ID of the article. 28 ''' 29 def __init__(self, mesh_id: List[str], mention: str, type: str, prob: float, span_begin: int, span_end: int, article: Article = None, source: str = 'abstract', pmid: str = ''): 30 self.mesh_id = mesh_id 31 self.mention = mention 32 self.type = type 33 self.prob = prob 34 self.span_begin = span_begin 35 self.span_end = span_end 36 self.article = article 37 self.source = source 38 self.pmid = pmid
View Source
Article(title: str, abstract: Optional[str], full_text: Optional[str], pmid: str, publication_data: datetime.datetime)
#  
Article(
title: str,
abstract: Optional[str],
full_text: Optional[str],
pmid: str,
publication_data: datetime.datetime
)
View Source
14class Entity: 15 ''' 16 Entity defines a gene or a disease in a text. 17 18 Parameters 19 20 mesh_id (List[str]): List of Unique identifier for the entity, e.g. MESH:D001234. (You can use the MESH ID to look up the name of the entity in the MESH database.) 21 mention (str): The string that is associated with the entity in the text (e.g. "BRCA1"). 22 type (str): The type of the entity. Can be 'gene' or 'disease'. 23 prob (float): The probability of the entity, it indicates the confidence of the model prediction. 24 span_begin (int): The begin of the span of the entity. 25 span_end (int): The end of the span of the entity. 26 article (Article): The article the entity is associated with. 27 source (str): The source of the entity within the article. Can be 'abstract' or 'full_text'. Defaults to 'abstract'. 28 pmid (str): The PubMed ID of the article. 29 ''' 30 def __init__(self, mesh_id: List[str], mention: str, type: str, prob: float, span_begin: int, span_end: int, article: Article = None, source: str = 'abstract', pmid: str = ''): 31 self.mesh_id = mesh_id 32 self.mention = mention 33 self.type = type 34 self.prob = prob 35 self.span_begin = span_begin 36 self.span_end = span_end 37 self.article = article 38 self.source = source 39 self.pmid = pmid
Entity defines a gene or a disease in a text.
Parameters
mesh_id (List[str]): List of Unique identifier for the entity, e.g. MESH:D001234. (You can use the MESH ID to look up the name of the entity in the MESH database.)
mention (str): The string that is associated with the entity in the text (e.g. "BRCA1").
type (str): The type of the entity. Can be 'gene' or 'disease'.
prob (float): The probability of the entity, it indicates the confidence of the model prediction.
span_begin (int): The begin of the span of the entity.
span_end (int): The end of the span of the entity.
article (Article): The article the entity is associated with.
source (str): The source of the entity within the article. Can be 'abstract' or 'full_text'. Defaults to 'abstract'.
pmid (str): The PubMed ID of the article.
#  
Entity(
mesh_id: List[str],
mention: str,
type: str,
prob: float,
span_begin: int,
span_end: int,
article: pubmad.types.Article = None,
source: str = 'abstract',
pmid: str = ''
)
View Source
30 def __init__(self, mesh_id: List[str], mention: str, type: str, prob: float, span_begin: int, span_end: int, article: Article = None, source: str = 'abstract', pmid: str = ''): 31 self.mesh_id = mesh_id 32 self.mention = mention 33 self.type = type 34 self.prob = prob 35 self.span_begin = span_begin 36 self.span_end = span_end 37 self.article = article 38 self.source = source 39 self.pmid = pmid