Update README.md
Browse files
README.md
CHANGED
@@ -4,106 +4,83 @@ language:
|
|
4 |
license: apache-2.0
|
5 |
base_model: google/flan-t5-small
|
6 |
tags:
|
7 |
-
-
|
|
|
|
|
8 |
datasets:
|
9 |
-
- sentence-paraphrases
|
10 |
-
model-index:
|
11 |
-
- name: flan-t5-small-simplifier
|
12 |
-
results: []
|
13 |
---
|
|
|
14 |
|
15 |
-
|
16 |
-
should probably proofread and complete it, then remove this comment. -->
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
|
|
|
|
21 |
|
22 |
-
|
23 |
-
It achieves the following results on the evaluation set:
|
24 |
-
- Loss: 1.1518
|
25 |
-
- Num Input Tokens Seen: 32939232
|
26 |
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
# Check if GPU is available
|
36 |
-
device = 0 if torch.cuda.is_available() else -1
|
37 |
-
|
38 |
-
# Initialize the pipeline
|
39 |
-
model_name = "agentlans/flan-t5-small-simplifier"
|
40 |
-
flan_t5_pipeline = pipeline("text2text-generation", model=model_name, device=device)
|
41 |
-
|
42 |
-
# Example input
|
43 |
-
input_text = "While navigating the labyrinthine corridors of epistemological uncertainty, the precocious philosopher—whose seminal work on phenomenological interpretation had already garnered significant academic acclaim—paused momentarily to contemplate the intricate interplay between subjective perception and objective reality, ultimately recognizing that the boundaries of human understanding are perpetually fluid and dynamically reconstructed through continuous intellectual discourse and empirical investigation."
|
44 |
-
|
45 |
-
# Generate output
|
46 |
-
output = flan_t5_pipeline(input_text, max_length=1024)
|
47 |
-
|
48 |
-
# Print the result
|
49 |
-
print(output[0]["generated_text"])
|
50 |
-
# The precocious philosopher, who had already been a major academic acclaim for his seminal work on phenomenological interpretation, paused momentarily to contemplate the intricate interplay between subjective perception and objective reality, recognizing that the boundaries of human understanding are perpetually fluid and dynamically reconstructed through continuous intellectual discourse and empirical investigation.
|
51 |
-
```
|
52 |
|
53 |
-
Limitations
|
54 |
-
- English
|
55 |
-
-
|
56 |
-
-
|
57 |
|
58 |
-
##
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
This dataset is a curated collection of sentence-length paraphrases derived from two primary sources:
|
63 |
-
|
64 |
-
humarin/chatgpt-paraphrases
|
65 |
-
xwjzds/paraphrase_collections.
|
66 |
-
|
67 |
-
Dataset Details
|
68 |
-
Dataset Description
|
69 |
-
|
70 |
-
The dataset is structured to provide pairs of sentences from an original text and its paraphrase(s). For each entry:
|
71 |
|
72 |
-
|
73 |
-
|
|
|
74 |
|
75 |
-
|
76 |
|
77 |
-
|
|
|
78 |
|
79 |
-
|
|
|
80 |
|
81 |
-
|
82 |
-
- learning_rate: 5e-05
|
83 |
-
- train_batch_size: 8
|
84 |
-
- eval_batch_size: 8
|
85 |
-
- seed: 42
|
86 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
87 |
-
- lr_scheduler_type: linear
|
88 |
-
- num_epochs: 2.0
|
89 |
|
90 |
-
|
|
|
|
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
| 1.3595 | 0.8897 | 40000 | 1.1787 | 14653328 |
|
98 |
-
| 1.3059 | 1.1121 | 50000 | 1.1665 | 18326104 |
|
99 |
-
| 1.3298 | 1.3345 | 60000 | 1.1589 | 21991016 |
|
100 |
-
| 1.2994 | 1.5569 | 70000 | 1.1562 | 25656600 |
|
101 |
-
| 1.2952 | 1.7794 | 80000 | 1.1518 | 29314808 |
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
-
|
105 |
|
106 |
- Transformers 4.43.3
|
107 |
-
-
|
108 |
- Datasets 3.2.0
|
109 |
-
|
|
|
|
|
|
|
|
4 |
license: apache-2.0
|
5 |
base_model: google/flan-t5-small
|
6 |
tags:
|
7 |
+
- text-simplification
|
8 |
+
- paraphrase
|
9 |
+
- natural-language-processing
|
10 |
datasets:
|
11 |
+
- agentlans/sentence-paraphrases
|
|
|
|
|
|
|
12 |
---
|
13 |
+
# FLAN-T5 Small Simplifier
|
14 |
|
15 |
+
A fine-tuned text simplification and paraphrasing model based on Google's FLAN-T5 Small, designed to enhance text readability while preserving core semantic meaning.
|
|
|
16 |
|
17 |
+
## Model Details
|
18 |
|
19 |
+
- **Base Model**: [google/flan-t5-small](https://huggingface.co/google/flan-t5-small)
|
20 |
+
- **Task**: Text Simplification and Paraphrasing
|
21 |
+
- **Languages**: English
|
22 |
|
23 |
+
## Capabilities
|
|
|
|
|
|
|
24 |
|
25 |
+
The model is specialized in:
|
26 |
+
- Reducing text complexity
|
27 |
+
- Generating more readable paraphrases
|
28 |
+
- Maintaining original semantic content
|
29 |
|
30 |
+
## Intended Use
|
31 |
|
32 |
+
**Primary Use Cases**:
|
33 |
+
- Academic writing simplification
|
34 |
+
- Technical document readability enhancement
|
35 |
+
- Content adaptation for diverse audiences
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
**Limitations**:
|
38 |
+
- Optimized for English language texts
|
39 |
+
- Best performance on sentence-length inputs
|
40 |
+
- May struggle with highly specialized or mixed-language texts
|
41 |
|
42 |
+
## Usage Example
|
43 |
|
44 |
+
```python
|
45 |
+
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
+
simplifier = pipeline(
|
48 |
+
"text2text-generation", model="agentlans/flan-t5-small-simplifier"
|
49 |
+
)
|
50 |
|
51 |
+
complex_text = "While navigating the labyrinthine corridors of epistemological uncertainty, the precocious philosopher paused to contemplate the intricate interplay between subjective perception and objective reality."
|
52 |
|
53 |
+
simplified_text = simplifier(complex_text, max_length=128)[0]["generated_text"]
|
54 |
+
print(simplified_text)
|
55 |
|
56 |
+
# The precocious philosopher paused to contemplate the complex interplay between subjective perception and objective reality while navigating the labyrinthine corridors of epistemological uncertainty.
|
57 |
+
```
|
58 |
|
59 |
+
## Training Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
+
**Dataset**: [agentlans/sentence-paraphrases](https://huggingface.co/datasets/agentlans/sentence-paraphrases)
|
62 |
+
- Source: Curated paraphrase collections
|
63 |
+
- Readability assessment using a finetuned [DeBERTa v3 XSmall](https://huggingface.co/agentlans/deberta-v3-xsmall-zyda-2-readability)
|
64 |
|
65 |
+
**Training Hyperparameters**:
|
66 |
+
- Learning Rate: 5e-05
|
67 |
+
- Batch Size: 8
|
68 |
+
- Optimizer: Adam
|
69 |
+
- Epochs: 2.0
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
+
**Performance Metrics**:
|
72 |
+
| Epoch | Training Loss | Validation Loss |
|
73 |
+
|:-----:|:-------------:|:---------------:|
|
74 |
+
| 0.22 | 1.4423 | 1.2431 |
|
75 |
+
| 0.89 | 1.3595 | 1.1787 |
|
76 |
+
| 1.78 | 1.2952 | 1.1518 |
|
77 |
|
78 |
+
## Framework
|
79 |
|
80 |
- Transformers 4.43.3
|
81 |
+
- PyTorch 2.3.0+cu121
|
82 |
- Datasets 3.2.0
|
83 |
+
|
84 |
+
## Ethical Considerations
|
85 |
+
|
86 |
+
Users should review generated text for accuracy and appropriateness, as the model may inherit biases from training data.
|