File size: 895 Bytes
06585ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f87f3aa
 
 
 
 
 
 
 
 
 
0747d6b
f87f3aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
license: bsd
datasets:
- ManthanKulakarni/Text2JQL_v2
language:
- en
library_name: transformers
pipeline_tag: text2text-generation
tags:
- Jira
- Atlasian
- T5
- Flan-T5
- JQL
- Query
---


## Model in Action 🚀

```python
from transformers import AutoModelWithLMHead, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("ManthanKulakarni/Text2JQLBuilder_v2")
model = AutoModelWithLMHead.from_pretrained("ManthanKulakarni/Text2JQLBuilder_v2")

def gen_sentence(words, max_length=64):
  input_text = words
  features = tokenizer([input_text], return_tensors='pt')

  output = model.generate(input_ids=features['input_ids'], 
               attention_mask=features['attention_mask'],
               max_length=max_length)

  return tokenizer.decode(output[0], skip_special_tokens=True)

words = "JQL: all story under project ACM"

gen_sentence(words)

# output: 'JQL: project = ACM'
```