File size: 2,652 Bytes
663fe1d
7271768
ffe2265
2e4274a
 
663fe1d
 
e8022c9
2e4274a
6a93c1a
 
 
 
 
 
 
 
2e4274a
663fe1d
 
 
2e4274a
 
 
 
b036855
2e4274a
b036855
2e4274a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: Text Style Transfer
emoji: πŸ“• πŸ”€ πŸ“˜
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.10.0
python_version: 3.9.7
app_file: apps/app.py
models:
  [
    "sentence-transformers/all-MiniLM-L6-v2",
    "cffl/bert-base-styleclassification-subjective-neutral",
    "cffl/bart-base-styletransfer-subjective-to-neutral",
    "cointegrated/roberta-base-formality",
    "prithivida/informal_to_formal_styletransfer",
  ]
pinned: true
license: apache-2.0
---

# Exploring Intelligent Writing Assistance

A demonstration of how the NLP task of _text style transfer_ can be applied to enhance the human writing experience using [HuggingFace Transformers](https://huggingface.co/) and [Streamlit](https://streamlit.io/).

![](static/images/app_screenshot.png)

> This repo accompanies Cloudera Fast Forward Labs' [blog series](https://blog.fastforwardlabs.com/2022/03/22/an-introduction-to-text-style-transfer.html) in which we  explore the task of automatically neutralizing subjectivity bias in free text.

The goal of this application is to demonstrate how the NLP task of text style transfer can be applied to enhance the human writing experience. In this sense, we intend to peel back the curtains on how an intelligent writing assistant might function β€” walking through the logical steps needed to automatically re-style a piece of text (from informal-to-formal **or** subjective-to-neutral) while building up confidence in the model output.

Through the application, we emphasize the imperative for a human-in-the-loop user experience when designing natural language generation systems. We believe text style transfer has the potential to empower writers to better express themselves, but not by blindly generating text. Rather, generative models, in conjunction with interpretability methods, should be combined to help writers understand the nuances of linguistic style and suggest stylistic edits that may improve their writing.

## Project Structure

```
.
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ apps
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ app_utils.py
β”‚   β”œβ”€β”€ data_utils.py
β”‚   └── visualization_utils.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ scripts
β”‚   β”œβ”€β”€ download_models.py
β”‚   β”œβ”€β”€ install_dependencies.py
β”‚   └── launch_app.py
β”œβ”€β”€ setup.py
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ content_preservation.py
β”‚   β”œβ”€β”€ style_classification.py
β”‚   β”œβ”€β”€ style_transfer.py
β”‚   └── transformer_interpretability.py
β”œβ”€β”€ static
β”‚   └── images
└── tests
    β”œβ”€β”€ __init__.py
    └── test_model_classes.py
```