fuhsiao commited on
Commit
8d32d05
·
1 Parent(s): 3841e50

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -0
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ metrics:
5
+ - rouge
6
+ ---
7
+ The model is a fine-tuned version of [GanjinZero/biobart-v2-base](https://huggingface.co/GanjinZero/biobart-v2-base) on PMC articles with a structured format
8
+
9
+ **Note:**
10
+ The model input is a set of sentences extracted by other sentence classifiers first, instead of directly using the full text of the section. The target output is the corresponding structured abstract.
11
+
12
+
13
+ ```python
14
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
15
+
16
+ # load model
17
+ model_name = 'fuhsiao/BioBART-PMC-EXT-Section'
18
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
19
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
20
+
21
+ # example
22
+ text = """ Suicide is a major challenge for the public health system, accounting for over 800,000 deaths each year worldwide.
23
+ Prisoners constitute such a risk group. Prisoners represent one extreme on the spectrum of delinquency, and are exposed to a particularly high risk of suicide, with suicide rates about 5 to 8 times higher than in the general population.
24
+ First, prisoners show behaviour and personality traits associated with suicide, even before imprisonment; these risk factors are imported into the prison environment.
25
+ The first weeks of imprisonment are particularly important for suicide prevention, since a considerable proportion of suicides in prisons occur during this period.
26
+ Only isolated studies have examined whether these factors are related to early suicide in prison, and these show a connection between drug addiction and early prison suicide.
27
+ To the best of our knowledge, this is the first study that uses a case-control design to investigate whether suicides in the first weeks of imprisonment differ from late prison suicide events in terms of their risk and resilience factors.
28
+ Previous prison sentences are negatively associated with early suicides, as this knowledge of the prison environment facilitates the process of re-adaptation.
29
+ Offences that are closely associated with drug use, such as theft, or offences against the narcotics law, are associated with early suicide events.
30
+ Evidence of mental illness or drug withdrawal is associated with early prison suicides. Assignment of a psychiatrist is protective against suicides during the first days of detention.
31
+ Risk factors change with increasing prison time. """
32
+
33
+ inputs = tokenizer(text, truncation=True, return_tensors='pt').input_ids
34
+ outputs = model.generate(inputs)
35
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
36
+ ```