GithubHelp home page GithubHelp logo

princeton-nlp / webshop Goto Github PK

View Code? Open in Web Editor NEW
245.0 12.0 47.0 46.69 MB

[NeurIPS 2022] ๐Ÿ›’WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents

Home Page: https://webshop-pnlp.github.io

License: MIT License

Python 89.45% Shell 1.17% CSS 1.26% HTML 8.11%
decision-making language language-grounding ml nlp rl rl-environment shopping sim-to-real web-based

webshop's Introduction

๐Ÿ›’ WebShop

Python version License PyPI version Pytest workflow

Implementation of the WebShop environment and search agents for the paper:

WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents
Shunyu Yao*, Howard Chen*, John Yang, Karthik Narasimhan

This repository contains code for reproducing results. If you find this work useful in your research, please cite:

@inproceedings{yao2022webshop,
  bibtex_show = {true},
  title = {WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents},
  author = {Yao, Shunyu and Chen, Howard and Yang, John and Narasimhan, Karthik},
  booktitle = {ArXiv},
  year = {preprint},
  html = {https://arxiv.org/abs/2207.01206},
  tag = {NLP}
}

๐Ÿ“– Table of Contents

๐Ÿ‘‹ Overview

WebShop is a simulated e-commerce website environment with 1.18 million real-world products and 12,087 crowd-sourced text instructions. In this environment, an agent needs to navigate multiple types of webpages and issue diverse actions to find, customize, and purchase a product given an instruction. WebShop provides several challenges including understanding compositional instructions, query (re-)formulation, dealing with noisy text in webpages, and performing strategic exploration.

Hugging Face Demo: Devise your own natural language query for a product and ask for an agent trained with WebShop to find it on Amazon or eBay, deployed as a ๐Ÿค— Hugging Face space here!

Python Package: If you would like to interact with the WebShop environment interface instead of installing and setting up the source code, you can install the webshop python package directly. The project page contains (WIP) documentation on how to use the library, and the library can be installed via pip install webshop.

๐Ÿš€ Setup

Our code is implemented in Python. To setup, do the following:

  1. Install Python 3.8.13
  2. Install Java
  3. Download the source code:
> git clone https://github.com/princeton-nlp/webshop.git webshop
  1. Create a virtual environment using Anaconda and activate it
> conda create -n webshop python=3.8.13
> conda activate webshop
  1. Install requirements into the webshop virtual environment via the setup.sh script
> ./setup.sh [-d small|all]

The setup script performs several actions in the following order:

  • Installs Python dependencies listed in requirements.txt
  • Downloads product and instruction data for populating WebShop
  • Downloads spaCy en_core_web_lg model
  • Construct search engine index from product, instruction data
  • Downloads 50 randomly chosen trajectories generated by MTurk workers The -d flag argument allows you to specify whether you would like to pull the entire product + instruction data set (-d all) or a subset of 1000 random products (-d small).
  1. By default the WebShop only loads 1,000 products for a faster environment preview. To load all products, change web_agent_site/utils.py:
# DEFAULT_ATTR_PATH = join(BASE_DIR, '../data/items_ins_v2_1000.json')
# DEFAULT_FILE_PATH = join(BASE_DIR, '../data/items_shuffle_1000.json')
DEFAULT_ATTR_PATH = join(BASE_DIR, '../data/items_ins_v2.json')
DEFAULT_FILE_PATH = join(BASE_DIR, '../data/items_shuffle.json')
  1. (Optional) Download ResNet image feature files here and put into data/ for running models that require image features.

  2. (Optional) Human demonstration data and be downloaded here.

๐Ÿ› ๏ธ Usage

The WebShop environment can be rendered in two modes - html and simple - each of which offer a different observation space. The simple mode strips away the extraneous meta-data that the html mode includes to make model training and evaluation easier.

Webpage Environment (html mode)

Launch the WebShop webpage:

> ./run_dev.sh

The site should then be viewable in the browser. Go to http://localhost:3000/ABC, where you should land on the search home page with a random instruction.

Navigating the website will automatically generate a corresponding trajectory file in the user_session_logs/mturk folder. Each file corresponds to a single instruction/web session, and each step of the file corresponds to a single action (i.e. search[...], click[...]).

The current WebShop build comes with two flags:

  • --log: Include this flag to create a trajectory .jsonl log file of actions on WebShop
  • --attrs: Include this flag to display an Attributes tab on the item_page of WebShop

Text Environment (simple mode)

The simple mode of the WebShop environment is packaged and readily available as an OpenAI environment. The OpenAI gym definitions of the text environment can be found in the web_agent_site/envs folder.

To start using the gym and building agents that interact with the WebShop environment, include the following statements in your Python file:

import gym
from web_agent_site.envs import WebAgentTextEnv

env = gym.make('WebAgentTextEnv-v0', observation_mode='text', num_products=...)

Now, you can write your own agent that interacts with the environment via the standard OpenAI gym interface.

Examples of a RandomPolicy agent interacting with the WebShop environment in both html and simple mode can be found in the run_envs folder. To run these examples locally, run the run_web_agent_text_env.sh or run_web_agent_site_env.sh script:

> ./run_web_agent_text_env.sh
Products loaded.
Keys Cleaned.
Attributes Loaded.
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1000/1000
Loaded 6910 goals.
Amazon Shopping Game [SEP] Instruction: [SEP] Find me slim f...
Available actions: {'has_search_bar': True, 'clickables': ['search']}
Taking action "search[shoes]" -> Reward = 0.0
...

In order to run the run_web_agent_site_env.sh script, you must download a version of ChromeDriver compatible with your Chrome browser version. Once you have downloaded and unzipped the executable, rename it chromedriver and place it in the webshop/envs folder.

Baseline Models

To run baseline models (rule, IL, RL, IL+RL) from the paper, please refer to the README.md in the baseline_models folder.

Sim-to-real Transfer

To read more about how the sim-to-real transfer of agents trained on WebShop to other environments works, please refer to the README.md in the transfer folder.

๐Ÿ’ซ Contributions

We would love to hear from the broader NLP and Machine Learning community, and we welcome any contributions, pull requests, or issues! To do so, please either file a new pull request or issue and fill in the corresponding templates accordingly. We'll be sure to follow up shortly!

๐Ÿชช License

Check LICENSE.md

webshop's People

Contributors

howard50b avatar john-b-yang avatar rish-raghu avatar ysymyth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webshop's Issues

How to reset instruction?

I'm submitting a question

env = gym.make('WebAgentTextEnv-v0', observation_mode='text_rich', num_products=DEBUG_PROD_SIZE)

0 round:
env.reset()
my url is:
'http://127.0.0.1:3000/ihjvksdtfm'
env.get_instruction_text()
i get "Instruction: Find me machine wash men's dress shirts with cotton spandex, classic fit, short sleeve with color: white, and size: x-large tall, and price lower than 60.00 dollars"

when i finish this task, i run env.reset()
my url is
'http://127.0.0.1:3000/ayfoedaown'
1 round:
env.get_instruction_text()
i get anthor instruction๏ผš
"Instruction: Find me slim fit, machine wash women's jumpsuits, rompers & overalls with short sleeve, high waist, polyester spandex for daily wear with color: green stripe, and size: large, and price lower than 50.00 dollars"

but i want back to 0 round, when is use env.reset(instruction_text="Instruction: Find me machine wash men's dress shirts with cotton spandex, classic fit, short sleeve with color: white, and size: x-large tall, and price lower than 60.00 dollars")
env.get_instruction_text()
i doesn't get the old instruction, otherwise i get a new instruction!

what should i do?

Do you have a copy of the train/dev/test splits?

Hello! I may have missed it in the paper and repo but do you have a copy of the samples within your train/dev/test splits? It might be good for us to use the same test split so our results are more comparable to yours. Thank you!

Reproducing paper results

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

Hi I would like to know if we should expect the pretrained models provided in this repo to reproduce the results from the paper?

Steps to Reproduce

I can the test.py script with the pretrained models provided (and default args), but I wasn't able to reproduce the results from the paper.

What is the expected behavior?

Can the author clarify if the pretrained models should be able to reproduce results from the paper.

Motivation for Change

NA

Please tell us about your environment:

NA

cannot import name 'url_quote' from 'werkzeug.urls'

hi there, I followed the setup installation but when I execute: from web_agent_site.envs import WebAgentTextEnv
it elicits error:

ImportError Traceback (most recent call last)
Cell In[1], line 2
1 import gym
----> 2 from web_agent_site.envs import WebAgentTextEnv

File ~/benchmark/webshop/web_agent_site/envs/init.py:3
1 from gym.envs.registration import register
----> 3 from web_agent_site.envs.web_agent_site_env import WebAgentSiteEnv
4 from web_agent_site.envs.web_agent_text_env import WebAgentTextEnv
6 register(
7 id='WebAgentSiteEnv-v0',
8 entry_point='web_agent_site.envs:WebAgentSiteEnv',
9 )

File ~/benchmark/webshop/web_agent_site/envs/web_agent_site_env.py:16
14 from selenium.webdriver.common.keys import Keys
15 from selenium.common.exceptions import ElementNotInteractableException
---> 16 from web_agent_site.engine.engine import parse_action, END_BUTTON
18 class WebAgentSiteEnv(gym.Env):
19 """Gym environment for HTML mode of WebShop environment"""

File ~/benchmark/webshop/web_agent_site/engine/engine.py:14
12 from tqdm import tqdm
13 from rank_bm25 import BM25Okapi
---> 14 from flask import render_template_string
15 from rich import print
16 from pyserini.search.lucene import LuceneSearcher

File ~/anaconda3/envs/webshop/lib/python3.8/site-packages/flask/init.py:7
4 from werkzeug.utils import redirect as redirect
6 from . import json as json
----> 7 from .app import Flask as Flask
8 from .app import Request as Request
9 from .app import Response as Response

File ~/anaconda3/envs/webshop/lib/python3.8/site-packages/flask/app.py:27
24 from werkzeug.routing import Rule
25 from werkzeug.wrappers import Response as BaseResponse
---> 27 from . import cli
28 from . import json
29 from .config import Config

File ~/anaconda3/envs/webshop/lib/python3.8/site-packages/flask/cli.py:17
14 from werkzeug.utils import import_string
16 from .globals import current_app
---> 17 from .helpers import get_debug_flag
18 from .helpers import get_env
19 from .helpers import get_load_dotenv

File ~/anaconda3/envs/webshop/lib/python3.8/site-packages/flask/helpers.py:14
12 import werkzeug.utils
13 from werkzeug.routing import BuildError
---> 14 from werkzeug.urls import url_quote
16 from .globals import _app_ctx_stack
17 from .globals import _request_ctx_stack

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/yanan/anaconda3/envs/webshop/lib/python3.8/site-packages/werkzeug/urls.py)

any solution ?
thanks

[Installation Issues] - Arm-based Mac (M1, M2, M3); faiss-cpu; Werkzeug.urls, spacy

Various Installation Issues (especially on arm-based mac).

  • [ X ] bug report

What is the current behavior?

  • Currently installation following the README file is not possible on arm-based mac (not sure about other environments, but suspect some errors are cross platform).

Steps to Reproduce

./setup.sh

What is the expected behavior?

It should install OOB on arm-based Mac (and other platforms).

Motivation for Change

Not installing properly and so not usable.

Please tell us about your environment:

  • MacOS 14
  • arm-based chip

Missing "action" information in demonstration data

Hi,

I looked into the demonstration data jsonl files and I could not find the "action" information in the demo trajectories. If you could provide some help on locating the action information, it would be very helpful! There is a similar issue raised by @yuchen-x but seems it was closed before being answered. So just wanted to resurface it.

FYI: the old issue by @yuchen-x:
"""
Thank you very much for your earlier response!

I looked into the jsonl files and realized that the format was different from the log of your ReAct code (WebShop.ipynb), for instance, I didn't detect the corresponding "action" in the demo trajectories. I was wondering if you already had any parser to transfer the human demonstrations into the format as the log of your ReAct code. If you could share the parser with us, that would be greatly helpful and appreciated!

Thank you, again!

Originally posted by @yuchen-x in #21 (comment)
"""

Doubt about training data

Hi,

In the readme for baseline model it is mentioned to unzip some training data : unzip il_trajs_finalized_images.zip.

This was not download as part of ./setup.sh. Could you provide the download link for this?

Reproducing Rule-based baseline and not matching paper results

Hey Authors,

I tried replicating the results for rule-based baseline.
In paper, the mentioned metrics for the same are: Score / SR = 45.8 / 19%
while replicating it, I am getting folloiwng values for metrics: Score / SR = 26.27 / 3.59%

The values of all reward variables are also not matching the paper's baseline. I obtained
r_type: 0.5826
r_attr: 0.4108
r_option: 0.0
r_price: 0.0632

Can you check for the anomaly?

Score and Success Rate

Question:

  1. I am training the RL agent using train_rl.py. How can I get the score and success rate metrics as per the paper?

Note: running for the default configuration for reproducibility.

| EpisodeScore | 6.88 |
| EpisodeScore_beauty | 7.06 |
| EpisodeScore_electro... | 6.68 |
| EpisodeScore_fashion | 7.36 |
| EpisodeScore_garden | 6.12 |
| EpisodeScore_grocery | 7.39 |
| FPS | 3 |
| ItemsClicked | 78782 |
| Step | 259400 |
| action_Description | 276853 |
| action_Features | 276669 |
| action_Reviews | 237 |
| action_asin | 276410 |
| action_options | 83631 |
| action_purchase | 270265 |
| action_search | 279761 |
| advs | -0.00239 |
| cat_beauty | 60688 |
| cat_electronics | 47598 |
| cat_fashion | 55063 |
| cat_garden | 53171 |
| cat_grocery | 53880 |
| gradnorm_clipped | 670 |
| gradnorm_unclipped | 1.61e+03 |
| loss | 3.1 |
| loss_en | -0.0982 |
| loss_il | 0 |
| loss_pg | 0.0476 |
| loss_td | 3.15 |
| r_att | 0.781 |
| r_exact | 0.0112 |
| r_harsh | 0.326 |
| r_norm | 0.196 |
| r_option | 0.308 |
| r_price | 0.966 |
| r_type | 0.953 |
| r_visit | 0 |
| rank_item | 4.21 |
| returns | 4.99 |

  1. Regarding the run time, this is the script I am using to run the code,
    #SBATCH --cpus-per-task=16
    #SBATCH --gres=gpu:v100:1 # Ask for 1 GPU #v100
    #SBATCH --mem=64G
    #SBATCH --time=80:00:00

Even after running for 80 hrs, the code for train_rl.py fails at 250K steps out of 300K steps as default. However, in the paper, it is mentioned that the run time is around a day. Am I missing something? Please share your insights.

Thank you for your time

when I run test.py, shows missing feat_conv.pt

When I run test.py under baseline model directory, it was complaining "/data/feat_conv.pt" not found. Would it be possible to share this file together with the feat_ids.pt file? Thanks.

Live site is down?

It seems the live site can't be accessed. I've tried multiple devices and VPNs.

Live Site not working

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

The live site on http://3.83.245.205:3000/ isn't working.

Steps to Reproduce

Could you reactivate the website?

What is the expected behavior?

Can open website

Motivation for Change

Easier to experiment on the dataset

Please tell us about your environment:

Chrome website

Server does not work

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

Please describe the current behavior of the WebShop app or agent

The server with the IP http://3.83.245.205:3000 seems not work now?

1000 products, but no product is found

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

When I run the random policy or even step an action manually (eg.: search by shoes, a very common product), no product is found. I tried with other strings (bags, durable, jumpsuits), but no product works.

Steps to Reproduce

env.reset()
env.step('search[shoes]')

What is the expected behavior?

At least one product should be returned in the search results, but it always returns "(Total results: 0)"

Please tell us about your environment:

Both Google Colab and Linux.

list out of range

ๆˆ‘้€š่ฟ‡webshopๆญๅปบ็Žฏๅขƒ๏ผŒๅœจ่ฟ่กŒbolaaๆ—ถ๏ผŒๅ‡บ็Žฐไธ‹้ข็š„้”™่ฏฏ๏ผš
127.0.0.1 - - [05/Sep/2023 15:12:46] "GET /fixed_23 HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/liang/miniconda/envs/webshop/lib/python3.8/site-packages/flask/app.py", line 2095, in call
return self.wsgi_app(environ, start_response)
File "/home/liang/miniconda/envs/webshop/lib/python3.8/site-packages/flask/app.py", line 2080, in wsgi_app
response = self.handle_exception(e)
File "/home/liang/miniconda/envs/webshop/lib/python3.8/site-packages/flask/app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "/home/liang/miniconda/envs/webshop/lib/python3.8/site-packages/flask/app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/liang/miniconda/envs/webshop/lib/python3.8/site-packages/flask/app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "/home/liang/miniconda/envs/webshop/lib/python3.8/site-packages/flask/app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/mnt/e/liang/codes/task1QA/26_Bolaa/WebShop/web_agent_site/app.py", line 71, in index
goal = goals[goal_dix]
ๆŸฅ็œ‹ไฟกๆฏๆ˜ฏๆฒกๆœ‰็”Ÿๆˆ่ถณๅคŸๅคš็š„fixed_id.jsonๆ–‡ไปถ๏ผŒ่ฏท้—ฎ่ฟ™ไธŽๆˆ‘ๅŠ ่ฝฝๆ•ฐๆฎ้›†ๅฐ‘ๆœ‰ๅ…ณ็ณปๅ—๏ผŸๆˆ‘ไฝฟ็”จ็š„ๆ˜ฏๆ•ฐ้‡ไธบ1000็š„ๆ•ฐๆฎ้›†๏ผŒ่€Œไธๆ˜ฏๅ…จ้ƒจใ€‚

ImportError: ../libmkl_gnu_thread.so: invalid ELF header

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

Please describe the current behavior of the WebShop app or agent

  • After all the installation and when I try to run ./run_dev.sh, I get the following error:
Traceback (most recent call last):
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/juyoung/webshop/web_agent_site/app.py", line 14, in <module>
    from web_agent_site.engine.engine import (
  File "/home/juyoung/webshop/web_agent_site/engine/engine.py", line 16, in <module>
    from pyserini.search.lucene import LuceneSearcher
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/pyserini/search/__init__.py", line 19, in <module>
    from .lucene import JLuceneSearcherResult, LuceneSimilarities, LuceneFusionSearcher, LuceneSearcher
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/__init__.py", line 18, in <module>
    from ._impact_searcher import JImpactSearcherResult, LuceneImpactSearcher
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/_impact_searcher.py", line 28, in <module>
    from pyserini.encode import QueryEncoder, TokFreqQueryEncoder, UniCoilQueryEncoder, \
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/pyserini/encode/__init__.py", line 17, in <module>
    from ._base import DocumentEncoder, QueryEncoder, JsonlCollectionIterator,\
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/pyserini/encode/_base.py", line 19, in <module>
    import faiss
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/faiss/__init__.py", line 18, in <module>
    from .loader import *
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/faiss/loader.py", line 65, in <module>
    from .swigfaiss import *
  File "/home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/faiss/swigfaiss.py", line 13, in <module>
    from . import _swigfaiss
ImportError: /home/juyoung/.conda/envs/webshop/lib/python3.8/site-packages/faiss/../../.././libmkl_gnu_thread.so: invalid ELF header
  • FYI, I downloaded Java like this: sudo apt install openjdk-11-jdk.

Steps to Reproduce

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • I first confronted this error in my environment, so I tried to use a docker image python:3.8.13-slim to see if this error can be reproduced. And I get a similar error, too:
Traceback (most recent call last):
  File "/usr/local/envs/webshop/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/envs/webshop/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/src/app/webshop/web_agent_site/app.py", line 14, in <module>
    from web_agent_site.engine.engine import (
  File "/usr/src/app/webshop/web_agent_site/engine/engine.py", line 16, in <module>
    from pyserini.search.lucene import LuceneSearcher
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/pyserini/search/__init__.py", line 19, in <module>
    from .lucene import JLuceneSearcherResult, LuceneSimilarities, LuceneFusionSearcher, LuceneSearcher
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/__init__.py", line 18, in <module>
    from ._impact_searcher import JImpactSearcherResult, LuceneImpactSearcher
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/_impact_searcher.py", line 28, in <module>
    from pyserini.encode import QueryEncoder, TokFreqQueryEncoder, UniCoilQueryEncoder, \
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/pyserini/encode/__init__.py", line 17, in <module>
    from ._base import DocumentEncoder, QueryEncoder, JsonlCollectionIterator,\
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/pyserini/encode/_base.py", line 19, in <module>
    import faiss
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/faiss/__init__.py", line 16, in <module>
    from .loader import *
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/faiss/loader.py", line 65, in <module>
    from .swigfaiss import *
  File "/usr/local/envs/webshop/lib/python3.8/site-packages/faiss/swigfaiss.py", line 13, in <module>
    from . import _swigfaiss
ImportError: libmkl_intel_lp64.so.1: cannot open shared object file: No such file or directory
  • It seems like there are some issues with pyserini and faiss for me, but there are no issues about this. Can you help me with set up process?

What is the expected behavior?

Please describe the desired behavior of the WebShop app or agent

Motivation for Change

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Version: 2.0.0-beta.X
  • Browser:
  • Language:

Reward function, data distribution, and the choice oracle

I have some questions and hope you can help me answer

  • In reward computation, a query_match feature was considered, which doesnโ€™t seem to be either the 5 course-grain product categories nor the chained fine-grain categories. Is it something else?
  • We find that 8248/10587 of training instances and 387/500 of test instances have options, while only 147/1000 of the development set instances have options, which doesnโ€™t seem to be i.i.d. We wonder if thereโ€™s a specific reason that leads to this difference.
  • Weโ€™re trying to reproduce the "Results with a Choice oracleโ€, we follow the paper to use instruction text as search query to get 50 search results and try all the items and option combinations to find the item with highest reward when comparing against the human goal. In test set, we get a 86.8% success rate which is much different than the 52.6% reported. We directly call the reward function in a way similar to the snippet attached below.

Please let me know if any of these questions are unclear, thanks!

all_products, product_item_dict, product_prices, _ = load_products(filepath="data/items_shuffle.json", num_products=None, human_goals=True)
...
for j in range(0, 500):
    d = all_data[j]
    item_info = []
    search_result_items = d['all_item_detailsโ€™] # search results from instructions
    for i in range(len(search_result_items)):
        item_asin = search_result_items[i][0].upper()
        product = product_item_dict[item_asin]
        all_options = list(product['options'].values())
        # generate all possible combinations of options
        all_combinations = list(itertools.product(*all_options))
        if len(all_combinations) > 0:
            maxr = -1
            maxinfo = None
            for c in all_combinations:
                reward, info = get_reward(product, human_goals[j], product_prices[item_asin], dict(enumerate(c)), verbose=True)
                if reward > maxr:
                    maxr = reward
                    maxinfo = info
                    if reward == 1.0:
                        break
            info = maxinfo
            reward = maxr
        else:
            reward, info = get_reward(product, human_goals[j], product_prices[item_asin], [], verbose=True)
        info['r_total'] = reward
        item_info.append(info)
    train_info.append(item_info)

Duplicates in instructions?

Unless I did something wrong I think you have some duplicates in your 12,087 instruction set.

I found 498 duplicates in the goals list in app.py

JVM exception occured

Faced the below error :

Products loaded.
Keys cleaned.
Attributes loaded.
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1181436/1181436 [00:25<00:00, 45656.08it/s]
Process SpawnProcess-1:
Traceback (most recent call last):
  File "/opt/conda/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 315, in _bootstrap
    self.run()
  File "/opt/conda/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/harsh777111raj/AgentBench/src/tasks/webshop/__init__.py", line 38, in predict
    env = WebAgentTextEnv(observation_mode="text", human_goals=True)
  File "/home/harsh777111raj/AgentBench/src/tasks/webshop/web_agent_site/envs/web_agent_text_env.py", line 61, in __init__
    self.server = SimServer(
  File "/home/harsh777111raj/AgentBench/src/tasks/webshop/web_agent_site/envs/web_agent_text_env.py", line 299, in __init__
    self.search_engine = init_search_engine(num_products=num_products)
  File "/home/harsh777111raj/AgentBench/src/tasks/webshop/web_agent_site/engine/engine.py", line 206, in init_search_engine
    search_engine = LuceneSearcher(os.path.join(BASE_DIR, f'../search_engine/{indexes}'))
  File "/opt/conda/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/_searcher.py", line 51, in __init__
    self.object = JLuceneSearcher(index_dir)
  File "jnius/jnius_export_class.pxi", line 270, in jnius.JavaClass.__init__
  File "jnius/jnius_export_class.pxi", line 384, in jnius.JavaClass.call_constructor
  File "jnius/jnius_utils.pxi", line 79, in jnius.check_exception
jnius.JavaException: JVM exception occurred: no segments* file found in MMapDirectory@/home/harsh777111raj/AgentBench/src/tasks/webshop/search_engine/indexes lockFactory=org.apache.lucene.store.NativeFSLockFactory@6e4566f1: files: [] org.apache.lucene.index.IndexNotFoundException

error when running run_dev.sh

I'm submitting a ...

  • [ x] bug report
  • feature request

What is the current behavior?

I'm having the following error when running run_dev.sh (after doing all the previous steps):
anybody was able to fix this:?

(webshop) esf0@DESKTOP-5CVVTN8:/webshop$ ./run_dev.sh Traceback (most recent call last): File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/esf0/webshop/web_agent_site/app.py", line 23, in from web_agent_site.engine.goal import get_reward, get_goals File "/home/esf0/webshop/web_agent_site/engine/goal.py", line 6, in import spacy File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/init.py", line 14, in from . import pipeline # noqa: F401 File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/pipeline/init.py", line 1, in from .attributeruler import AttributeRuler File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/pipeline/attributeruler.py", line 6, in from .pipe import Pipe File "spacy/pipeline/pipe.pyx", line 8, in init spacy.pipeline.pipe
File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/training/init.py", line 11, in from .callbacks import create_copy_from_base_model # noqa: F401 File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/training/callbacks.py", line 3, in from ..language import Language File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/language.py", line 25, in from .training.initialize import init_vocab, init_tok2vec File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/training/initialize.py", line 14, in from .pretrain import get_tok2vec_ref File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/training/pretrain.py", line 16, in from ..schemas import ConfigSchemaPretrain File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/site-packages/spacy/schemas.py", line 216, in class TokenPattern(BaseModel): File "pydantic/main.py", line 299, in pydantic.main.ModelMetaclass.new File "pydantic/fields.py", line 411, in pydantic.fields.ModelField.infer File "pydantic/fields.py", line 342, in pydantic.fields.ModelField.init File "pydantic/fields.py", line 451, in pydantic.fields.ModelField.prepare File "pydantic/fields.py", line 545, in pydantic.fields.ModelField._type_analysis File "pydantic/fields.py", line 550, in pydantic.fields.ModelField._type_analysis File "/home/esf0/anaconda3/envs/webshop/lib/python3.8/typing.py", line 774, in subclasscheck return issubclass(cls, self.origin) TypeError: issubclass() arg 1 must be a class (webshop) esf0@DESKTOP-5CVVTN8:
/webshop$

Steps to Reproduce

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Please describe the desired behavior of the WebShop app or agent

Motivation for Change

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Version: 2.0.0-beta.X
  • Browser:
  • Language:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.