File size: 1,781 Bytes
7b2ab6a
 
 
2d13de5
cad971e
2d13de5
cad971e
 
 
 
 
2d13de5
cad971e
2d13de5
cad971e
 
2d13de5
7b2ab6a
a84312b
7b2ab6a
 
 
 
a84312b
 
7b2ab6a
 
 
 
61498f0
7b2ab6a
 
a84312b
 
7b2ab6a
 
 
61498f0
7b2ab6a
2d13de5
 
 
89d59fb
a84312b
89d59fb
 
 
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
43
44
45
46
47
48
---
license: apache-2.0
---
Fine-tuned version of IBM Granite 3.3 2b base

Accepts a research project title and summary and creates a largely extractive breakdown (with some minor tweaks for coherence) into:
* context and background
* problem and aim
* approach and methodology
* outcomes and impact

with seperate keywords for each of these breakdowns.

Additionally includes lists of:
* application areas - where the research is indicated as applying to
* expected beneficiaries - where indicated within the document

Usage:
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
import json

input_title: str = "your project title here"
input_summary: str = "your summary here"
model_name: str = "Lux-In-Tenebris/research_summary_deconstructor"

device = "cuda" if torch.cuda.is_available() else "cpu"
model = AutoModelForCausalLM.from_pretrained(model_name, dtype=torch.bfloat16).to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name)
model.eval()

input_text = json.dumps({"title": input_title, "summary": input_summary}, ensure_ascii=False)
inputs = tokenizer(input_text, return_tensors="pt", truncation=False, padding=False).to(device)

with torch.no_grad():
  outputs = model.generate(**inputs, max_new_tokens=8_192, temperature=1.0, do_sample=True)
generated_tokens = outputs[0][inputs["input_ids"].shape[1]:]
decoded = tokenizer.decode(generated_tokens, skip_special_tokens=True)
```

Will of course need adjustment for batch processing, and highly recommend checking for invalid json and additional characters being output.

Trained on approx 5000 synthetic research project titles, summaries, and structured elements, for 2 epochs using an RTX6000 Pro
* Learning rate: 3e-5
* Effective batch size: 128
* Time taken: Under 2 hours