init
This commit is contained in:
3
browser_env/html_tools/configs/__init__.py
Normal file
3
browser_env/html_tools/configs/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .html_prompt import prompts
|
||||
from .config import basic_attrs, mind2web_keep_attrs, miniwob_attrs
|
||||
from .config import config_meta
|
||||
49
browser_env/html_tools/configs/config.py
Normal file
49
browser_env/html_tools/configs/config.py
Normal file
@@ -0,0 +1,49 @@
|
||||
basic_attrs = [
|
||||
'title',
|
||||
'value',
|
||||
'placeholder',
|
||||
'selected',
|
||||
]
|
||||
|
||||
mind2web_keep_attrs = [
|
||||
'alt',
|
||||
'aria_description',
|
||||
'aria_label',
|
||||
'aria_role',
|
||||
'input_checked',
|
||||
'input_value',
|
||||
'label',
|
||||
'name',
|
||||
'option_selected',
|
||||
'placeholder',
|
||||
'role',
|
||||
'text_value',
|
||||
'title',
|
||||
'type',
|
||||
'value',
|
||||
]
|
||||
|
||||
miniwob_attrs = [
|
||||
'id',
|
||||
'type',
|
||||
'value',
|
||||
]
|
||||
|
||||
config_meta = """
|
||||
======= Configs =======
|
||||
Columns:
|
||||
- id: {id_attr}
|
||||
- label: {label_attr}
|
||||
Position: {use_position}
|
||||
- window: {window_size}
|
||||
- rect_dict: {rect}
|
||||
Keep:
|
||||
- parents: {parent_chain}
|
||||
- attrs: {keep_attrs}
|
||||
- elems: {keep_elem}
|
||||
- obs_elem: {obs_elem}
|
||||
Generator:
|
||||
- prompt: {prompt_name}
|
||||
- label: {identifier_name}
|
||||
========================
|
||||
"""
|
||||
22
browser_env/html_tools/configs/html_prompt.py
Normal file
22
browser_env/html_tools/configs/html_prompt.py
Normal file
@@ -0,0 +1,22 @@
|
||||
refine_prompt = {
|
||||
'dom': '<{tag}{label}|{attr}{content}{subtree} >',
|
||||
'label': '[{label}]',
|
||||
'attr': '{attr}',
|
||||
'attr_splitter': '; ',
|
||||
'subtree_splitter': ' ',
|
||||
}
|
||||
|
||||
xml_prompt = {
|
||||
'dom': '<{tag}{label}{attr}>{content}{subtree} </{tag}>',
|
||||
'label': ' id="{label}"',
|
||||
'attr': '{key}="{attr}"',
|
||||
'attr_splitter': ' ',
|
||||
'subtree_splitter': ' ',
|
||||
}
|
||||
|
||||
prompts = {
|
||||
'refine': refine_prompt,
|
||||
'xml': xml_prompt,
|
||||
'new_data': refine_prompt,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user