z-uo commited on
Commit
d129f24
1 Parent(s): 07c59c8

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -0
README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ datasets:
4
+ - z-uo/qasper-squad
5
+ ---
6
+
7
+ # roberta-base for QA with qasper
8
+ Train from deepset/roberta-base-squad2.
9
+
10
+ How to use by python code:
11
+ ```python
12
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
13
+
14
+ # Load model with pipeline
15
+ model_name = "z-uo/roberta-qasper"
16
+ nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
17
+
18
+ # Get predictions
19
+ QA_input = {
20
+ 'question': 'what they propose?',
21
+ 'context': "In this paper, we provide an innovative contribution in the research domain dedicated to crop mapping by exploiting the of Sentinel-2 satellite images time series, with the specific aim to extract information on 'where and when' crops are grown. The final goal is to set up a workflow able to reliably identify (classify) the different crops that are grown in a given area by exploiting an end-to-end (3+2)D convolutional neural network (CNN) for semantic segmentation. The method also has the ambition to provide information, at pixel level, regarding the period in which a given crop is cultivated during the season. To this end, we propose a solution called Class Activation Interval (CAI) which allows us to interpret, for each pixel, the reasoning made by CNN in the classification determining in which time interval, of the input time series, the class is likely to be present or not. Our experiments, using a public domain dataset, show that the approach is able to accurately detect crop classes with an overall accuracy of about 93% and that the network can detect discriminatory time intervals in which crop is cultivated. These results have twofold importance: (i) demonstrate the ability of the network to correctly interpret the investigated physical process (i.e., bare soil condition, plant growth, senescence and harvesting according to specific cultivated variety) and (ii) provide further information to the end-user (e.g., the presence of crops and its temporal dynamics)."
22
+ }
23
+
24
+ res = nlp(QA_input)
25
+
26
+ # Load model & tokenizer without pipeline
27
+ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
28
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
29
+ ```