atrytone commited on
Commit
1d4b5e7
1 Parent(s): 7fdf035

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -16
README.md CHANGED
@@ -8,6 +8,8 @@ metrics:
8
  - recall
9
  - precision
10
  library_name: transformers
 
 
11
  ---
12
 
13
  This model is a fine-tuned version of [arazd/MIReAD](https://huggingface.co/arazd/MIReAD) on a dataset of Neuroscience papers from 200 journals collected from various sources.
@@ -34,27 +36,34 @@ To load the model:
34
 
35
  ```py
36
  from transformers import BertForSequenceClassification, AutoTokenizer
37
- mpath = 'atrytone/MIReAD-Neuro'
38
- model = BertForSequenceClassification.from_pretrained(mpath)
39
- tokenizer = AutoTokenizer.from_pretrained(mpath)
40
  ```
41
 
42
- To create embeddings:
43
 
44
  ```py
45
  # sample abstract & title text
46
- title = 'MIReAD: simple method for learning scientific representations'
47
- abstr = 'Learning semantically meaningful representations from scientific documents can ...'
48
- text = title + tokenizer.sep_token + abstr
49
- tokens = tokenizer(sents,
50
- max_length=512,
51
- padding=True,
52
- truncation=True,
53
- return_tensors="pt"
54
- )
 
 
 
55
  with torch.no_grad():
56
- out = model.bert(**tokens)
57
- feature = out.last_hidden_state[:, 0, :]
 
 
 
 
58
  ```
59
 
60
  ## Training procedure
@@ -65,4 +74,4 @@ The following hyperparameters were used during training:
65
  - learning_rate: 3e-05
66
  - train_batch_size: 16
67
  - eval_batch_size: 16
68
- - num_epochs: 6
 
8
  - recall
9
  - precision
10
  library_name: transformers
11
+ widget:
12
+ - text: The past 25 years have seen a strong increase in the number of publications related to criticality in different areas of neuroscience. The potential of criticality to explain various brain properties, including optimal information processing, has made it an increasingly exciting area of investigation for neuroscientists. Recent reviews on this topic, sometimes termed brain criticality, make brief mention of clinical applications of these findings to several neurological disorders such as epilepsy, neurodegenerative disease, and neonatal hypoxia. Other clinicallyrelevant domains - including anesthesia, sleep medicine, developmental-behavioral pediatrics, and psychiatry - are seldom discussed in review papers of brain criticality. Thorough assessments of these application areas and their relevance for clinicians have also yet to be published. In this scoping review, studies of brain criticality involving human data of all ages are evaluated for their current and future clinical relevance. To make the results of these studies understandable to a more clinical audience, a review of the key concepts behind criticality (e.g., phase transitions, long-range temporal correlation, self-organized criticality, power laws, branching processes) precedes the discussion of human clinical studies. Open questions and forthcoming areas of investigation are also considered.
13
  ---
14
 
15
  This model is a fine-tuned version of [arazd/MIReAD](https://huggingface.co/arazd/MIReAD) on a dataset of Neuroscience papers from 200 journals collected from various sources.
 
36
 
37
  ```py
38
  from transformers import BertForSequenceClassification, AutoTokenizer
39
+ model_path = "atrytone/MIReAD-Neuro"
40
+ model = BertForSequenceClassification.from_pretrained(model_path)
41
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
42
  ```
43
 
44
+ To create embeddings and for classification:
45
 
46
  ```py
47
  # sample abstract & title text
48
+ title = "Why Brain Criticality Is Clinically Relevant: A Scoping Review."
49
+ abstract = "The past 25 years have seen a strong increase in the number of publications related to criticality in different areas of neuroscience..."
50
+ text = title + tokenizer.sep_token + abstract
51
+ tokens = tokenizer(
52
+ text,
53
+ max_length=512,
54
+ padding=True,
55
+ truncation=True,
56
+ return_tensors="pt"
57
+ )
58
+
59
+ # to generate an embedding from a given title and abstract
60
  with torch.no_grad():
61
+ output = model.bert(**tokens)
62
+ embedding = output.last_hidden_state[:, 0, :]
63
+
64
+ # to classify (200 journals) a given title and abstract
65
+ output = model(**tokens)
66
+ class = output.logits
67
  ```
68
 
69
  ## Training procedure
 
74
  - learning_rate: 3e-05
75
  - train_batch_size: 16
76
  - eval_batch_size: 16
77
+ - num_epochs: 6