Skip to content

Commit b7174c7

Browse files
authored
Improve website (#10)
* Create a readme for docs, add script to convert to webp * create webp versions of the files * update conversion script and readme * Add webnav figures * Add lazy loading and alts for images * Update theme changing button to have a name * Make webnav.demo smaller * embed fonts
1 parent b0189cb commit b7174c7

31 files changed

+70
-19
lines changed

docs/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Docs
2+
3+
## Build docs
4+
5+
To build the docs, run this from the project root:
6+
7+
```bash
8+
python docs/scripts/build_docs.py
9+
```
10+
11+
It should generate new markdown files in `docs/_docs`.
12+
13+
## Convert images to webp
14+
15+
To convert images to webp, run this from the project root:
16+
17+
```bash
18+
# convert docs/assets/images/examples
19+
python docs/scripts/convert_to_webp.py -d docs/assets/images/examples --height 400
20+
```

docs/_includes/masthead.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<ul class="visible-links">
1818
{% if site.dark_theme_css %}
1919
<li class="masthead__menu-item">
20-
<a onclick="changeTheme()"><i class="fas fa-fw fa-sun"></i></a>
20+
<a name="Change Theme Button" onclick="changeTheme()"><i class="fas fa-fw fa-sun"></i></a>
2121
</li>
2222
{% endif %}
2323

docs/_pages/home.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ excerpt: "Real-world website navigation with multi-turn dialogue"
4646
<img src="{{ '/assets/images/webnav.demo.svg' | relative_url }}" style="width: 90%; max-width: 900px; align-content: center; margin: auto; display: flex">
4747

4848

49-
### About WebLINX
49+
## About WebLINX
5050

5151
WEBLINX is a large-scale benchmark of 100K interactions across 2300 expert demonstrations of *conversational web navigation*.
5252
Our benchmark covers a broad range of patterns on over 150 real-world websites and can be used to train and evaluate agents in diverse scenarios.
5353

54-
<img src="{{ '/assets/images/examples/ai.1.oyuiubm.png' | relative_url }}" width="24%">
55-
<img src="{{ '/assets/images/examples/booking.1.pxtuocd.png' | relative_url }}" width="24%">
56-
<img src="{{ '/assets/images/examples/composing.1.tbtnzql.png' | relative_url }}" width="24%">
57-
<img src="{{ '/assets/images/examples/lookup.1.zbrxcee.png' | relative_url }}" width="24%">
58-
<img src="{{ '/assets/images/examples/productivity.1.ytcgitj.png' | relative_url }}" width="24%">
59-
<img src="{{ '/assets/images/examples/shopping.1.wbamufj.png' | relative_url }}" width="24%">
60-
<img src="{{ '/assets/images/examples/social.1.xmrqcyz.png' | relative_url }}" width="24%">
61-
<img src="{{ '/assets/images/examples/summarizing.1.bctdmtt.png' | relative_url }}" width="24%">
54+
<img loading="lazy" alt="Example of ai tasks" src="{{ '/assets/images/examples/ai.1.oyuiubm.webp' | relative_url }}" width="24%" height="auto">
55+
<img loading="lazy" alt="Example of booking tasks" src="{{ '/assets/images/examples/booking.1.pxtuocd.webp' | relative_url }}" width="24%" height="auto">
56+
<img loading="lazy" alt="Example of composing tasks" src="{{ '/assets/images/examples/composing.1.tbtnzql.webp' | relative_url }}" width="24%" height="auto">
57+
<img loading="lazy" alt="Example of lookup tasks" src="{{ '/assets/images/examples/lookup.1.zbrxcee.webp' | relative_url }}" width="24%" height="auto">
58+
<img loading="lazy" alt="Example of productivity tasks" src="{{ '/assets/images/examples/productivity.1.ytcgitj.webp' | relative_url }}" width="24%" height="auto">
59+
<img loading="lazy" alt="Example of shopping tasks" src="{{ '/assets/images/examples/shopping.1.wbamufj.webp' | relative_url }}" width="24%" height="auto">
60+
<img loading="lazy" alt="Example of social tasks" src="{{ '/assets/images/examples/social.1.xmrqcyz.webp' | relative_url }}" width="24%" height="auto">
61+
<img loading="lazy" alt="Example of summarizing tasks" src="{{ '/assets/images/examples/summarizing.1.bctdmtt.webp' | relative_url }}" width="24%" height="auto">
6262

63-
### What is *conversational web navigation*?
63+
## What is *conversational web navigation*?
6464

6565
We propose the problem of *conversational web navigation*, where a digital agent controls a web browser and follows user instructions to solve real-world tasks in a multi-turn dialogue fashion. To accomplish this, agents can learn from expert demonstrations, as shown below:
6666

@@ -71,7 +71,7 @@ We propose the problem of *conversational web navigation*, where a digital agent
7171
</video>
7272

7373
<div style="width: 28%;">
74-
<img src="{{'/assets/images/booking.1.vcglzhn.messages.png' | relative_url}}" style="width: 100%; height: auto;">
74+
<img src="{{'/assets/images/booking.1.vcglzhn.messages.webp' | relative_url}}" style="width: 100%; height: auto;">
7575
</div>
7676
</div>
7777

@@ -83,7 +83,7 @@ Here, there should be a 3-column layout with the following content:
8383
2. The action and conversation history (preferably with nice text formatting)
8484
3. The screenshot -->
8585

86-
### Can we download WebLINX now?
86+
## Can we download WebLINX now?
8787

8888
__[You can find our dataset on Huggingface Datasets](https://huggingface.co/datasets/McGill-NLP/weblinx)__
8989

@@ -115,7 +115,7 @@ We provide the WebLINX Explorer, a tool to explore the dataset and see the inter
115115
Your browser does not support the video tag.
116116
</video>
117117

118-
### What if I want to download the raw data (HTML, screenshots, etc.)?
118+
## What if I want to download the raw data (HTML, screenshots, etc.)?
119119

120120
If you are interested in the full data, the easiest way to download the raw dataset is the use the `huggingface_hub` library with `snapshot_download`. We show you how in the [doc's prerequisite section]({{'/docs/#prerequisites' | relative_url }}).
121121

@@ -130,7 +130,7 @@ pip install weblinx
130130
Please take a look at the [library documentation]({{'/docs/' | relative_url }}) for more information on how to use it.
131131

132132

133-
### How can we use WebLINX to train agents?
133+
## How can we use WebLINX to train agents?
134134

135135
Our agent is composed of two main components: a __Dense Markup Ranker (DMR)__ and an __action model__.
136136

@@ -143,17 +143,17 @@ We experiment with 19 action models, ranging from smaller models (Flan-T5-MindAc
143143
<!-- There should be a card of 5 models here (MindAct, Pix2Act, Fuyu-8B, LLaMA-13B, GPT-4V) with links to the original papers of those models. -->
144144

145145

146-
### Where can we find the finetuned models?
146+
## Where can we find the finetuned models?
147147

148148
We provide the weights for the models we finetuned. You can [access them on Huggingface Hub](https://huggingface.co/collections/McGill-NLP/weblinx-models-65c57d4afeeb282d1dcf8434). We will share [code to reproduce our experiments on our GitHub repository](https://github.com/mcgill-nlp/weblinx). Please note that they were finetuned for research purposes (so they are not ready for production).
149149

150-
### How do we use the agent to control browsers?
150+
## How do we use the agent to control browsers?
151151

152152
Our `weblinx` library lets you convert the HTML into a format that can be received by DMR or by an action model, and `weblinx` can also parse valid model outputs into a dictionary that can be converted to browser commands.
153153

154154
You will need Selenium or Pupeteer to control the browser (take screenshot, grab HTML, insert unique IDs, execute action from dictionary); you can [learn selenium here](https://www.selenium.dev/documentation/webdriver/getting_started/).
155155

156-
### How do we cite WebLINX?
156+
## How do we cite WebLINX?
157157

158158
If you use our dataset, code, or models, please use the following `bibtex` citation entry:
159159

Binary file not shown.
15.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
21.6 KB
Binary file not shown.
19.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Binary file not shown.
Loading
Loading
Binary file not shown.
Loading
Loading
Binary file not shown.
Loading
Loading
Binary file not shown.
Loading
Loading
Binary file not shown.
Loading

docs/assets/images/webnav.demo.svg

+1-1
Loading

docs/scripts/convert_to_webp.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""
2+
Given a path to a directory, convert all images in the directory to webp format.
3+
"""
4+
import argparse
5+
from pathlib import Path
6+
7+
from PIL import Image
8+
9+
def convert_to_webp(directory: str, height: int = None, quality: int = 80):
10+
directory = Path(directory)
11+
exts = ['*.jpg', '*.jpeg', '*.png']
12+
for ext in exts:
13+
for im_path in directory.glob(ext):
14+
im = Image.open(im_path)
15+
# if height is provided, resize the image
16+
if height:
17+
im = im.resize((int(im.width * height / im.height), height))
18+
19+
im.save(im_path.with_suffix('.webp'), 'webp', quality=quality)
20+
21+
def main():
22+
parser = argparse.ArgumentParser(description='Convert all images in a directory to webp format.')
23+
parser.add_argument('-d', '--directory', type=str, help='Path to the directory containing images.')
24+
parser.add_argument('--height', type=int, help='New height of the output image. If this is provided, we will resize the image to this height.')
25+
parser.add_argument('--quality', type=int, help='Quality of the output image.', default=80)
26+
args = parser.parse_args()
27+
# convert to dict
28+
convert_to_webp(**vars(args))
29+
30+
if __name__ == '__main__':
31+
main()

0 commit comments

Comments
 (0)