Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
ArXiv:
Libraries:
Datasets
License:
WikiHow-taskset / README.md
zdy023's picture
ver Sep2ndv2
e29b1f6 unverified
---
license: apache-2.0
---
(Works with [Mobile-Env >=4.0](https://github.com/X-LANCE/Mobile-Env).)
# WikiHow Task Set
WikiHow task set is an InfoUI interaction task set based on
[Mobile-Env](https://github.com/X-LANCE/Mobile-Env) proposed in [*Mobile-Env:
Building Qualified Evaluation Benchmarks for LLM-GUI
Interaction*](https://arxiv.org/abs/2305.08144).
[WikiHow](https://www.wikihow.com/Main-Page) is a collaborative wiki site about
various real-life tips with more than 340,000 online articles. To construct the
task set, 107,448 pages are crawled, and the dumped website data occupy about
88 GiB totally.
Several task definition templates are designed according to the functions of
WikiHow app and task definitions are instantiated through the template toolkit
in Mobile-Env. 577 tasks are sampled from the extended set, which is named the
*canonical set* (`wikihow-canonical.tar.xz`). Owing to the limit of the
budgets, only 150 tasks are tested using the proposed LLM-based agent. These
150 tasks are given in `wikihow-microcanon.tar.xz`. We call it the *canonical
subset* or the *micro canonical set*.
### Website Data Replay
The replay script for [mitmproxy](https://mitmproxy.org/) is given as
`replay_url.py`. To use this replay script, the information retrieval tool
[Pyserini](https://github.com/castorini/pyserini/) is required. Four parameters
are expected to be assigned in the script:
+ The crawled data from WikiHow website (`dumps` in `wikihow.data.tar.xz`)
+ The HTML templates used to mock the search result page (`templates` in
`wikihow.data.tar.xz`)
+ The indices for the search engine based on Pyserini (`indices-t/indices` in
`wikihow.data.tar.xz`)
+ The metadata of the crawled articles (`indices-t/docs/doc_meta.csv` in
`wikihow.data.tar.xz`)
All the required data are offered in `wikihow.data.tar.xz`. (The archive is
about 78 GiB. And the decompressed data are about 88 GiB.) The archive is split
into two pieces (`wikihow.data.tar.xz.00` and `wikihow.data.tar.xz.01`). You
can use `cat` to concatenate them:
```sh
cat wikihow.data.tar.xz.00 wikihow.data.tar.xz.01 >wikihow.data.tar.xz
```
The SHA256 checksums are provided in `wikihow.data.tar.xz.sha256` to check the
integrity.
To set up the environment for mitmproxy server:
```sh
pip install -r requirements-mitm.txt
# Then you also need to set up JRE 11.0
# or comment out the PyPI parts in the file and uncomment the conda parts
conda create -n mitmproxy --file requirements-mitm.txt
# OpenJDK-11.0.13 will be installed automatically
```
The environment for mitmproxy server can be independent of the environment for
Mobile-Env.
To run the script:
```sh
mitmproxy --showhost -s replay_url.py
```
### Certificate Unpinning Plan
The `syscert` plan proposed by Mobile-Env works for WikiHow app. You can
complete the config according to the [guideline of
Mobile-Env](https://github.com/X-LANCE/Mobile-Env/blob/master/docs/dynamic-app-en.md).
The available APK package from [APKCombo](https://apkcombo.com/) is provided.
And note to use the AVD image of version Android 11.0 (API Level 30) (Google
APIs) to obtain the best compatibility and the root-enabled ADBD.
### Human-Rewritten Instructions
Human-rewritten instructions for the *canonical set* are release under
`instruction_rewriting/`. An AndroidEnv wrapper `InstructionRewritingWrapper`
is provided to load the rewritten instructions (`merged_doccano.json`) and
public patterns (`pattern-*.txt`). The annotations are collected via
[doccano](https://doccano.github.io/doccano/). The patterns are parsed by
[`sentence_pattern.py`](instruction_rewriting/sentence_pattern.py).
To use `InstructionRewritingWrapper`, NLTK and lemminflect is needed. You can
install them through:
```sh
pip install -r requirements-instruction_rewriting.txt
python -m nltk.downloader popular
```
If your data is not downloaded into a common place, you may need to set
`NLTK_DATA` environment variable. See [NLTK's
documents](https://www.nltk.org/data.html) for details.
### Details of Sub-Tasks
WikiHow taks are crafted from 16 types of sub-tasks:
* `home2search`, instructing to search for an article from the home page.
* `search2article`, `author2article`, & `category2article`, instructing to
access an article from search result page, author information page, and
category content page, respectively.
* `article2about`, instructing to access the about page from article page.
* `article2author`, instructing to access author information page from article
page.
* `article2category`, instructing to access category content page from article
page.
* `article2reference`, instructing to check reference list on article page.
* `article2rate_no`, instructing to rate no for article
* `article2rate_yes`, instructing to rate yes for article
* `article2share`, instructing to share article
* `article2bookmark`, instructing to bookmark article and then check the
bookmarks.
* `article2steps`, crafted from `stepped_summary` questions in
[wikihow-lists](https://huggingface.co/datasets/b-mc2/wikihow_lists)
* `article2ingredientes`, crafted from `ingredients` questions in
[wikihow-lists](https://huggingface.co/datasets/b-mc2/wikihow_lists)
* `article2needed_items`, crafted from `needed_items` questions in
[wikihow-lists](https://huggingface.co/datasets/b-mc2/wikihow_lists)
* `article2summary`, crafted from
[WikiHowNFQA](https://huggingface.co/datasets/Lurunchik/WikiHowNFQA) tasks
A template is composed for each sub-task, containing a group of filling slots
expecting some keywords like article title, author name, question, and
groundtruth answer. Then these keywords are sampled from the crawled app data
or from the two QA datasets to instantiate the templates. Subsequently, the
instantiated templates are concatenated into multi-stage task definitions under
the constraint that the target page/element/answer (the part after `2`, *e.g.*,
`share` from `article2share`) is directly on/referenced by the current page
(the part before `2`, *e.g.*, `article` from `article2share`). Finally, we
obtained the task set of 150 multistage tasks in which there are 2.68
single-stage sub-tasks averagely.
The multistage tasks containing different sub-tasks are suffixed with different
numbers. The meanings of suffixes and the number of suffixed tasks in the micro
canonical set are list in the following table:
| Suffix | Sub-tasks | #Tasks |
|--------|------------------------------------------|--------|
| 0 | `home-search-article-about` | 18 |
| 1 | `home-search-article-rate_no` | 6 |
| 2 | `home-search-article-rate_yes` | 10 |
| 3 | `home-search-article-share` | 11 |
| 4 | `home-search-article-author[-article]` | 7 |
| 5 | `home-search-article-bookmark` | 13 |
| 6 | `home-search-article-category[-article]` | 9 |
| 7 | `home-search-article-reference` | 11 |
| 8 | `home-search-article` | 25 |
| 9 | `home-search-steps` | 15 |
| 10 | `home-search-needed_items` | 10 |
| 11 | `home-search-ingredients` | 5 |
| 12 | `home-search-summary` | 10 |
### The Open World Tasks
As supplementary to WikiHow task set, we define 74 open world tasks on a wider
range of apps. The task definitions are stored under `open-world-set/`. The
online data for these tasks are not fixed, thus, these tasks will not be
expected to be reproducible to serve as qualified benchmarks.
#### Download the Open World Set
To test with the open world set, clone this repo or download
`open-world-set.tar.xz` and unpack it. Then download
`open-world-set-avd.tar.xz` and unpack it into a directory, *e.g.*,
`android-avds`. This Android AVD contains the necessary apps needed by the open
world set.
#### Set Up the Runtime Environment
The offered AVD is supposed to work in [Mobile-Env Docker
Image](https://hub.docker.com/r/zdy023/mobile-env). To use this image, you need
first clone Mobile-Env repository (>=v4.2). Then launch the container with the command:
```sh
docker run -it --device /dev/kvm --gpus all -v $PWD/android-avds:/root/.android -v $PWD/Mobile-Env:/root/mobile-env -v $PWD/open-world-set:/root/open-world-set zdy023/mobile-env:e928cf1-ubuntu20.04-cu121-android30-torch241
```
Run in the container:
```sh
cd mobile-env && pip install -e . # the dependences have been already installed, this command is to compile the proto files locally in the docker environment
```
Then you can run experiments within this docker image.
#### Additional Setup to AVD before Launching Experiments
Before experiments, you may need to sign in in Ele.me app in the AVD. To launch
the AVD in docker with a GUI interface using the host display, we recommend to
use [Distrobox](https://distrobox.it/).
```sh
distrobox create --root --hostname mobile-env --volume $PWD/android-avds:/root/.android --volume $PWD/Mobile-Env:/root/mobile-env -n mobile-env -i zdy023/mobile-env:e928cf1-ubuntu20.04-cu121-android30-torch241
distrobox enter --root mobile-env
# in the container
sudo -i --preserve-env=ANDROID_HOME,ADB_MDNS
# in `sudo -i`
export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/bin:$PATH
emulator @Pixel_2_ga_30_op -verbose -no-snapshot
```
#### Other Notices
1. Mobile-Env environment should be launched with `restart_simulator_at_reset`
option, *e.g.*:
```python
env = android_env.load( "/root/open-world-set", "Pixel_2_ga_30_op"
, run_headless=True, text_model=EasyOCRWrapper(lang_list=["en", "ch_sim"])
, coordinator_args={"restart_simulator_at_reset": True}
)
```
2. "Today Weather" app may require proxy to work normally in mainland China. To
pass the proxy information to Mobile-Env, use `mitm_config` parameter,
*e.g.*:
```python
env = android_env.load( "/root/open-world-set", "Pixel_2_ga_30_op"
, run_headless=True, text_model=EasyOCRWrapper(lang_list=["en", "ch_sim"])
, mitm_config={"method": "syscert", "address": "a.b.c.d", "port": "8000"}
, coordinator_args={"restart_simulator_at_reset": True}
)
```
### About
This task set is developed and maintained by [SJTU
X-Lance](https://x-lance.sjtu.edu.cn/en). The corresponding paper is available
at <https://arxiv.org/abs/2305.08144>.
If you find WikiHow task set useful in your research, you can cite the project
using the following BibTeX:
```bibtex
@article{DanyangZhang2023_MobileEnv_WikiHow,
title = {{Mobile-Env}: Building Qualified Evaluation Benchmarks for LLM-GUI Interaction},
author = {Danyang Zhang and
Zhennan Shen and
Rui Xie and
Situo Zhang and
Tianbao Xie and
Zihan Zhao and
Siyuan Chen and
Lu Chen and
Hongshen Xu and
Ruisheng Cao and
Kai Yu},
journal = {CoRR},
volume = {abs/2305.08144},
year = {2023},
url = {https://arxiv.org/abs/2305.08144},
eprinttype = {arXiv},
eprint = {2305.08144},
}
```