Code Monkey home page Code Monkey logo

wge's Introduction

StanfordNLP: A Python NLP Library for Many Human Languages

Travis Status PyPI Version Python Versions

⚠️ Note ⚠️

All development, issues, ongoing maintenance, and support have been moved to our new GitHub repository as the toolkit is being renamed as Stanza since version 1.0.0. Please visit our new website for more information. You can still download stanfordnlp via pip, but newer versions of this package will be made available as stanza. This repository is kept for archival purposes.

The Stanford NLP Group's official Python NLP library. It contains packages for running our latest fully neural pipeline from the CoNLL 2018 Shared Task and for accessing the Java Stanford CoreNLP server. For detailed information please visit our official website.

References

If you use our neural pipeline including the tokenizer, the multi-word token expansion model, the lemmatizer, the POS/morphological features tagger, or the dependency parser in your research, please kindly cite our CoNLL 2018 Shared Task system description paper:

@inproceedings{qi2018universal,
 address = {Brussels, Belgium},
 author = {Qi, Peng  and  Dozat, Timothy  and  Zhang, Yuhao  and  Manning, Christopher D.},
 booktitle = {Proceedings of the {CoNLL} 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies},
 month = {October},
 pages = {160--170},
 publisher = {Association for Computational Linguistics},
 title = {Universal Dependency Parsing from Scratch},
 url = {https://nlp.stanford.edu/pubs/qi2018universal.pdf},
 year = {2018}
}

The PyTorch implementation of the neural pipeline in this repository is due to Peng Qi and Yuhao Zhang, with help from Tim Dozat and Jason Bolton.

This release is not the same as Stanford's CoNLL 2018 Shared Task system. The tokenizer, lemmatizer, morphological features, and multi-word term systems are a cleaned up version of the shared task code, but in the competition we used a Tensorflow version of the tagger and parser by Tim Dozat, which has been approximately reproduced in PyTorch (though with a few deviations from the original) for this release.

If you use the CoreNLP server, please cite the CoreNLP software package and the respective modules as described here ("Citing Stanford CoreNLP in papers"). The CoreNLP client is mostly written by Arun Chaganty, and Jason Bolton spearheaded merging the two projects together.

Issues and Usage Q&A

To ask questions, report issues or request features, please use the GitHub Issue Tracker.

Setup

StanfordNLP supports Python 3.6 or later. We strongly recommend that you install StanfordNLP from PyPI. If you already have pip installed, simply run:

pip install stanfordnlp

this should also help resolve all of the dependencies of StanfordNLP, for instance PyTorch 1.0.0 or above.

If you currently have a previous version of stanfordnlp installed, use:

pip install stanfordnlp -U

Alternatively, you can also install from source of this git repository, which will give you more flexibility in developing on top of StanfordNLP and training your own models. For this option, run

git clone https://github.com/stanfordnlp/stanfordnlp.git
cd stanfordnlp
pip install -e .

Running StanfordNLP

Getting Started with the neural pipeline

To run your first StanfordNLP pipeline, simply following these steps in your Python interactive interpreter:

>>> import stanfordnlp
>>> stanfordnlp.download('en')   # This downloads the English models for the neural pipeline
# IMPORTANT: The above line prompts you before downloading, which doesn't work well in a Jupyter notebook.
# To avoid a prompt when using notebooks, instead use: >>> stanfordnlp.download('en', force=True)
>>> nlp = stanfordnlp.Pipeline() # This sets up a default neural pipeline in English
>>> doc = nlp("Barack Obama was born in Hawaii.  He was elected president in 2008.")
>>> doc.sentences[0].print_dependencies()

The last command will print out the words in the first sentence in the input string (or Document, as it is represented in StanfordNLP), as well as the indices for the word that governs it in the Universal Dependencies parse of that sentence (its "head"), along with the dependency relation between the words. The output should look like:

('Barack', '4', 'nsubj:pass')
('Obama', '1', 'flat')
('was', '4', 'aux:pass')
('born', '0', 'root')
('in', '6', 'case')
('Hawaii', '4', 'obl')
('.', '4', 'punct')

Note: If you are running into issues like OSError: [Errno 22] Invalid argument, it's very likely that you are affected by a known Python issue, and we would recommend Python 3.6.8 or later and Python 3.7.2 or later.

We also provide a multilingual demo script that demonstrates how one uses StanfordNLP in other languages than English, for example Chinese (traditional)

python demo/pipeline_demo.py -l zh

See our getting started guide for more details.

Access to Java Stanford CoreNLP Server

Aside from the neural pipeline, this project also includes an official wrapper for acessing the Java Stanford CoreNLP Server with Python code.

There are a few initial setup steps.

  • Download Stanford CoreNLP and models for the language you wish to use
  • Put the model jars in the distribution folder
  • Tell the python code where Stanford CoreNLP is located: export CORENLP_HOME=/path/to/stanford-corenlp-full-2018-10-05

We provide another demo script that shows how one can use the CoreNLP client and extract various annotations from it.

Online Colab Notebooks

To get your started, we also provide interactive Jupyter notebooks in the demo folder. You can also open these notebooks and run them interactively on Google Colab. To view all available notebooks, follow these steps:

  • Go to the Google Colab website
  • Navigate to File -> Open notebook, and choose GitHub in the pop-up menu
  • Note that you do not need to give Colab access permission to your github account
  • Type stanfordnlp/stanfordnlp in the search bar, and click enter

Trained Models for the Neural Pipeline

We currently provide models for all of the treebanks in the CoNLL 2018 Shared Task. You can find instructions for downloading and using these models here.

Batching To Maximize Pipeline Speed

To maximize speed performance, it is essential to run the pipeline on batches of documents. Running a for loop on one sentence at a time will be very slow. The best approach at this time is to concatenate documents together, with each document separated by a blank line (i.e., two line breaks \n\n). The tokenizer will recognize blank lines as sentence breaks. We are actively working on improving multi-document processing.

Training your own neural pipelines

All neural modules in this library, including the tokenizer, the multi-word token (MWT) expander, the POS/morphological features tagger, the lemmatizer and the dependency parser, can be trained with your own CoNLL-U format data. Currently, we do not support model training via the Pipeline interface. Therefore, to train your own models, you need to clone this git repository and set up from source.

For detailed step-by-step guidance on how to train and evaluate your own models, please visit our training documentation.

LICENSE

StanfordNLP is released under the Apache License, Version 2.0. See the LICENSE file for more details.

wge's People

Contributors

ezliu avatar ppasupat 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  avatar  avatar  avatar

wge's Issues

Adding a custom web task

Hello!

First of all, thank you for sharing your codes! I just have a few question regarding adding and creating a new web tasks:

  • Would it be possible to create custom web tasks by adding a new folder under third-party/html using the custom html files (just like how flight tasks are defined)?
  • If so, could you give me some pointers to what needs to be implemented in order for the custom task to be correctly integrated with the current code?
  • Do you think the current javascript codes already implemented (e.g. common/core.js) be reused to define the custom tasks?

Thank you.

error when running --task click-tab-2

Loading demonstrations: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 32/32 [00:00<00:00, 78.51it/s]
Loading GloVe embeddings: 99%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 99323/100000 [00:05<00:00, 16902.70it/s]
No GPUs detected. Sticking with CPUs.
No checkpoint to reload. Initializing fresh.
Inducing programs: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 32/32 [00:03<00:00, 9.69it/s]
No uncommitted changes.
New TrainingRun created at: /folder/data/experiments/1_unnamed
Outer training loop: 0%| | 0/50000 [00:00<?, ?it/s]ERROR:root:############################################################
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 1 / 5)
Traceback (most recent call last):
File "/folder/wge/episode_generator.py", line 62, in call
seeds, record_screenshots)
File "/folder/wge/episode_generator.py", line 93, in _get_episodes
actions = policy.act(states, test_policy)
File "/folder/wge/wob_policy.py", line 425, in act
action_scores_batch = self.score_actions(states)
File "/folder/wge/wob_policy.py", line 192, in score_actions
states, force_dom_attn, force_type_values)
File "/folder/wge/wob_policy.py", line 221, in _score_actions
dom_embeds, dom_elems = self._dom_embeds(states)
File "/folder/wge/wob_policy.py", line 502, in _dom_embeds
dom_elems, aligned_dom_embeds)
File "/Users/user/homebrew/anaconda3/envs/miniwob/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/folder/wge/miniwob/embeddings.py", line 406, in forward
pixel_neighbor_embeds, allow_empty=True)
File "/folder/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (9) must match the existing size (96) at non-singleton dimension 1. at /Users/soumith/minicondabuild3/conda-bld/pytorch_1518371252923/work/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...

error when running python main.py

hi:

when running python main.py configs/default-base.txt --task click-tab-2 the following error occurred, without changing any single line of code / data:

TrainingRun configuration:
gamma = 1.0
discount_negative_reward = false
train {
  max_control_steps = 50000
  learning_rate = 0.001
  behavioral_cloning = false
  replay = 5
  replay_steps = 30
  reinforce_program = true
  reinforce_neural = false
}
explore {
  program = 1
  neural = 10
  best_first_search = 10
  max_steps_per_episode = 10
  best_first_beam_size = 10
}
log {
  episodes_to_evaluate_small = 20
  episodes_to_evaluate_big = 500
  evaluate = 100
  evaluate_big = 500
  explore = 10
  replay = 10
  trace_evaluate = 1000
  trace_explore = 1000
  trace_replay = 1000
  save = 1000000000
  visualize_attention = 100000
  record_screenshots = false
}
replay_buffer {
  size = 1000
  min_size = 100
}
policy {
  query_type = "structured"
  episodes_to_replay = 5
  update_rule = "use-whole-episode"
  baseline = 0.1
  use_critic = true
  attn_dim = 64
  context_embed_dim = 96
  dom_attention_for_state = true
  scoring_batch_size = 64
  utterance_embedder {
    type = "glove"
    vocab_size = 100000
    lstm_dim = 64
  }
  dom_embedder {
    tag_embed_dim = 16
    value_embed_dim = 16
    tampered_embed_dim = 8
    classes_embed_dim = 16
  }
}
program_policy {
  type = "program"
  parameterization = "softmax"
  weight_init = 1.0
  learning_rate = 0.8
  alpha = 0.1
  init_v = 0.0
  max_programs = 50
}
env {
  domain = "miniwob"
  num_instances = 6
  subdomain = "click-tab-2"
  return_image = false
  headless = false
  wait_ms = 0
  block_on_reset = true
  refresh_freq = 50
  reward_processor {
    type = "time_independent"
  }
}
demonstrations {
  min_raw_reward = 1.0
  base_dir = "2017-10-16_second-turk"
  parser = "chunk-shortcut"
  max_to_use = 1000000000000
}
LOADING DEMOS FROM: /Users/wge/third-party/miniwob-demos/2017-10-16_second-turk/click-tab-2
Loading demonstrations: 100%|█████████████| 32/32 [00:00<00:00, 74.19it/s]
Loading GloVe embeddings: 100%|█▉| 99608/100000 [00:10<00:00, 9878.71it/s]No GPUs detected. Sticking with CPUs.
No checkpoint to reload. Initializing fresh.
No uncommitted changes.
New TrainingRun created at: /Users/data/experiments/2_unnamed
                                                              ERROR:root:############################################################/s]
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 1 / 5)
Traceback (most recent call last):
  File "/Users/wge/wge/episode_generator.py", line 62, in __call__
    seeds, record_screenshots)
  File "/Users/wge/wge/episode_generator.py", line 93, in _get_episodes
    actions = policy.act(states, test_policy)
  File "/Users/wge/wge/wob_policy.py", line 425, in act
    action_scores_batch = self.score_actions(states)
  File "/Users/wge/wge/wob_policy.py", line 192, in score_actions
    states, force_dom_attn, force_type_values)
  File "/Users/wge/wge/wob_policy.py", line 221, in _score_actions
    dom_embeds, dom_elems = self._dom_embeds(states)
  File "/Users/wge/wge/wob_policy.py", line 502, in _dom_embeds
    dom_elems, aligned_dom_embeds)
  File "/Users/env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/wge/wge/miniwob/embeddings.py", line 406, in forward
    pixel_neighbor_embeds, allow_empty=True)
  File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
    weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (9) must match the existing size (96) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...
ERROR:root:############################################################
ERROR:root:############################################################
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 2 / 5)
Traceback (most recent call last):
  File "/Users/wge/wge/episode_generator.py", line 62, in __call__
    seeds, record_screenshots)
  File "/Users/wge/wge/episode_generator.py", line 93, in _get_episodes
    actions = policy.act(states, test_policy)
  File "/Users/wge/wge/wob_policy.py", line 425, in act
    action_scores_batch = self.score_actions(states)
  File "/Users/wge/wge/wob_policy.py", line 192, in score_actions
    states, force_dom_attn, force_type_values)
  File "/Users/wge/wge/wob_policy.py", line 221, in _score_actions
    dom_embeds, dom_elems = self._dom_embeds(states)
  File "/Users/wge/wge/wob_policy.py", line 502, in _dom_embeds
    dom_elems, aligned_dom_embeds)
  File "/Users/env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/wge/wge/miniwob/embeddings.py", line 406, in forward
    pixel_neighbor_embeds, allow_empty=True)
  File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
    weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (7) must match the existing size (90) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...
ERROR:root:############################################################
ERROR:root:############################################################
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 3 / 5)
Traceback (most recent call last):
  File "/Users/wge/wge/episode_generator.py", line 62, in __call__
    seeds, record_screenshots)
  File "/Users/wge/wge/episode_generator.py", line 93, in _get_episodes
    actions = policy.act(states, test_policy)
  File "/Users/wge/wge/wob_policy.py", line 425, in act
    action_scores_batch = self.score_actions(states)
  File "/Users/wge/wge/wob_policy.py", line 192, in score_actions
    states, force_dom_attn, force_type_values)
  File "/Users/wge/wge/wob_policy.py", line 221, in _score_actions
    dom_embeds, dom_elems = self._dom_embeds(states)
  File "/Users/wge/wge/wob_policy.py", line 502, in _dom_embeds
    dom_elems, aligned_dom_embeds)
  File "/Users/env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/wge/wge/miniwob/embeddings.py", line 406, in forward
    pixel_neighbor_embeds, allow_empty=True)
  File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
    weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (6) must match the existing size (90) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...
ERROR:root:############################################################
ERROR:root:############################################################
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 4 / 5)
Traceback (most recent call last):
  File "/Users/wge/wge/episode_generator.py", line 62, in __call__
    seeds, record_screenshots)
  File "/Users/wge/wge/episode_generator.py", line 93, in _get_episodes
    actions = policy.act(states, test_policy)
  File "/Users/wge/wge/wob_policy.py", line 425, in act
    action_scores_batch = self.score_actions(states)
  File "/Users/wge/wge/wob_policy.py", line 192, in score_actions
    states, force_dom_attn, force_type_values)
  File "/Users/wge/wge/wob_policy.py", line 221, in _score_actions
    dom_embeds, dom_elems = self._dom_embeds(states)
  File "/Users/wge/wge/wob_policy.py", line 502, in _dom_embeds
    dom_elems, aligned_dom_embeds)
  File "/Users/env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/wge/wge/miniwob/embeddings.py", line 406, in forward
    pixel_neighbor_embeds, allow_empty=True)
  File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
    weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (7) must match the existing size (96) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...
ERROR:root:############################################################
ERROR:root:############################################################
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 5 / 5)
Traceback (most recent call last):
  File "/Users/wge/wge/episode_generator.py", line 62, in __call__
    seeds, record_screenshots)
  File "/Users/wge/wge/episode_generator.py", line 93, in _get_episodes
    actions = policy.act(states, test_policy)
  File "/Users/wge/wge/wob_policy.py", line 425, in act
    action_scores_batch = self.score_actions(states)
  File "/Users/wge/wge/wob_policy.py", line 192, in score_actions
    states, force_dom_attn, force_type_values)
  File "/Users/wge/wge/wob_policy.py", line 221, in _score_actions
    dom_embeds, dom_elems = self._dom_embeds(states)
  File "/Users/wge/wge/wob_policy.py", line 502, in _dom_embeds
    dom_elems, aligned_dom_embeds)
  File "/Users/env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/wge/wge/miniwob/embeddings.py", line 406, in forward
    pixel_neighbor_embeds, allow_empty=True)
  File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
    weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (7) must match the existing size (108) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...
ERROR:root:############################################################
ERROR:root:############################################################
ERROR:root:=== SOMETHING WRONG HAPPENED !!! === (Retry attempt 6 / 5)
Traceback (most recent call last):
  File "/Users/wge/wge/episode_generator.py", line 62, in __call__
    seeds, record_screenshots)
  File "/Users/wge/wge/episode_generator.py", line 93, in _get_episodes
    actions = policy.act(states, test_policy)
  File "/Users/wge/wge/wob_policy.py", line 425, in act
    action_scores_batch = self.score_actions(states)
  File "/Users/wge/wge/wob_policy.py", line 192, in score_actions
    states, force_dom_attn, force_type_values)
  File "/Users/wge/wge/wob_policy.py", line 221, in _score_actions
    dom_embeds, dom_elems = self._dom_embeds(states)
  File "/Users/wge/wge/wob_policy.py", line 502, in _dom_embeds
    dom_elems, aligned_dom_embeds)
  File "/Users/env/lib/python2.7/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/wge/wge/miniwob/embeddings.py", line 406, in forward
    pixel_neighbor_embeds, allow_empty=True)
  File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean
    weights = mask / sums.expand(*mask.size())
RuntimeError: The expanded size of the tensor (7) must match the existing size (102) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
ERROR:root:Will restart the environment and try again ...
ERROR:root:############################################################
Traceback (most recent call last):
  File "main.py", line 103, in <module>
    run.train()
  File "/Users/wge/wge/training_run.py", line 209, in train
    control_step)
  File "/Users/wge/wge/training_run.py", line 306, in _explore
    test_policy=False)
  File "/Users/wge/wge/episode_generator.py", line 73, in __call__
    raise RuntimeError('Envionment died too many times!')
RuntimeError: Envionment died too many times!

the root cause seems to be
File "/Users/wge/gtd/ml/torch/seq_batch.py", line 174, in reduce_mean weights = mask / sums.expand(*mask.size()) RuntimeError: The expanded size of the tensor (7) must match the existing size (108) at non-singleton dimension 1. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:309
but I'm not sure what wrong from here.

any idea what's wrong?

How to deploy a model

After training a model via the command:
python main.py configs/default-base.txt --task click-tab-2
Where does the trained model and how do I deploy the model to do the task that I want it to do?

error KeyError: '_module'

PS C:\Users\Dhaval\Downloads\uds-master> python3 uds.py push ~\Desktop\ffmpeg.exe
Traceback (most recent call last):
File "uds.py", line 534, in
main()
File "uds.py", line 452, in main
uds = UDS()
File "uds.py", line 46, in init
self.api = GoogleAPI()
File "C:\Users\Dhaval\Downloads\uds-master\api.py", line 19, in init
self.reauth()
File "C:\Users\Dhaval\Downloads\uds-master\api.py", line 25, in reauth
credentials = store.get()
File "C:\Users\Dhaval\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\oauth2client\client.py", line 407, in get
return self.locked_get()
File "C:\Users\Dhaval\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\oauth2client\file.py", line 54, in locked_get
credentials = client.Credentials.new_from_json(content)
File "C:\Users\Dhaval\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\oauth2client\client.py", line 302, in new_from_json
module_name = data['_module']
KeyError: '_module'

help me please reply me please

How to test the trained model?

Hi,

Thanks for the great repo.
I trained a model on the task "login-user" and save the checkpoints.
I want to test the model, but the documentation doesn't explain the test.
Is there a test program?
Or please help me any guide and tip for testing the model.

Thanks.
SeungKwon

how is reward defined in Alaska flight booking?

hi:

I looked into the Alaska flight booking template and didn't see any natural language instructions. How is reward defined in Alaska case? Does it reward whenever the 'find flights' button is clicked with all fields filled out? Any other constraint? I can see no date is included in the constraint (or is much more loosely given, ex: always in March 2017), given the success rate of [choose date] is .52 and Alaska flight booking has .86, not sure if any constraint included.

error when running python3 uds.py push ~\Desktop\ffmpeg.exe

PS C:\Users\Dhaval\Downloads\uds-master> python3 uds.py push ~\Desktop\ffmpeg.exe
Traceback (most recent call last):
File "uds.py", line 534, in
main()
File "uds.py", line 452, in main
uds = UDS()
File "uds.py", line 46, in init
self.api = GoogleAPI()
File "C:\Users\Dhaval\Downloads\uds-master\api.py", line 19, in init
self.reauth()
File "C:\Users\Dhaval\Downloads\uds-master\api.py", line 25, in reauth
credentials = store.get()
File "C:\Users\Dhaval\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\oauth2client\client.py", line 407, in get
return self.locked_get()
File "C:\Users\Dhaval\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\oauth2client\file.py", line 54, in locked_get
credentials = client.Credentials.new_from_json(content)
File "C:\Users\Dhaval\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\oauth2client\client.py", line 302, in new_from_json
module_name = data['_module']
KeyError: '_module'

reply me fast, help me out

duplicated folder?

why below folder are duplicated?

miniwob-sandbox/
third-party/miniwob-sandbox/

missing methods in script_tools.py?

This may not be an actual issue...
line 7 in launch_jobs.py (in the root of wge directory) seems to reference methods that are not defined in script_tools.py.

from script_tools import bash_string, upload_code, create_worksheet, task_lists, \ upload_demos

however, upload_code, create_worksheet, and upload_demos are included. Either they were left out b/c its very specific to the university blah blah blah. but it would be useful to have more context.

pytest error

hi:

when running pytest, the following error occurred, without changing any single line of code/data:

========================== test session starts ===========================
platform darwin -- Python 2.7.10, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
rootdir: /Users/wge/wge, inifile:
collected 9 items

wge/tests/miniwob/test_environment.py BASE URL: http://localhost:8765/
.BASE URL: http://localhost:8765/
========================================
[u'Click the button.', u'Click the button.', u'Click the button.']
[dummy: 'dummy', dummy: 'dummy', dummy: 'dummy']
FBASE URL: http://localhost:8765/
Iteration 1 / 50
Iteration 2 / 50
Iteration 3 / 50
Iteration 4 / 50
Iteration 5 / 50
Iteration 6 / 50
Iteration 7 / 50
Iteration 8 / 50
Iteration 9 / 50
Iteration 10 / 50
Iteration 11 / 50
Iteration 12 / 50
Iteration 13 / 50
Iteration 14 / 50
Iteration 15 / 50
Iteration 16 / 50
Iteration 17 / 50
Iteration 18 / 50
Iteration 19 / 50
Iteration 20 / 50
Iteration 21 / 50
Iteration 22 / 50
Iteration 23 / 50
Iteration 24 / 50
Iteration 25 / 50
Iteration 26 / 50
Iteration 27 / 50
Iteration 28 / 50
Iteration 29 / 50
Iteration 30 / 50
Iteration 31 / 50
Iteration 32 / 50
Iteration 33 / 50
Iteration 34 / 50
Iteration 35 / 50
Iteration 36 / 50
Iteration 37 / 50
Iteration 38 / 50
Iteration 39 / 50
Iteration 40 / 50
Iteration 41 / 50
Iteration 42 / 50
Iteration 43 / 50
Iteration 44 / 50
Iteration 45 / 50
Iteration 46 / 50
Iteration 47 / 50
Iteration 48 / 50
Iteration 49 / 50
Iteration 50 / 50
Average time: 0.0230975866318
SD: 0.000102856725524
.BASE URL: http://localhost:8765/
========================================
Clicking with click([4] button @ (61.0, 74.0) text=u'Click Me!' classes=[NO_CLASS])
{'n': [{u'reason': None, 'elapsed': 0.0477290153503418, u'done': False, u'raw_reward': 0, u'env_reward': 0}, {'elapsed': 0.34470105171203613, u'done': True, u'raw_reward': 1, u'env_reward': 0.9676}, {u'reason': None, 'elapsed': 0.3376748561859131, u'done': False, u'raw_reward': 0, u'env_reward': 0}]}
{'n': [{u'reason': None, 'elapsed': 0.10628294944763184, u'done': False, u'raw_reward': 0, u'env_reward': 0}, {'elapsed': 0.36610984802246094, u'done': True, u'raw_reward': 1, u'env_reward': 0.9676}, {u'reason': None, 'elapsed': 0.39337682723999023, u'done': False, u'raw_reward': 0, u'env_reward': 0}]}
{'n': [{u'reason': None, 'elapsed': 0.029836177825927734, u'done': False, u'raw_reward': 0, u'env_reward': 0}, {u'reason': None, 'elapsed': 0.05690813064575195, u'done': False, u'raw_reward': 0, u'env_reward': 0}, {u'reason': None, 'elapsed': 0.045066118240356445, u'done': False, u'raw_reward': 0, u'env_reward': 0}]}
Clicking with click([4] button @ (16.0, 97.0) text=u'Click Me!' classes=[NO_CLASS])
Clicking with click([4] button @ (34.0, 52.0) text=u'Click Me!' classes=[NO_CLASS])
{'n': [{'elapsed': 0.06305098533630371, u'done': True, u'raw_reward': 1, u'env_reward': 0.9937}, {'elapsed': 0.0776369571685791, u'done': True, u'raw_reward': 1, u'env_reward': 0.992}, {u'reason': None, 'elapsed': 0.06498408317565918, u'done': False, u'raw_reward': 0, u'env_reward': 0}]}
.BASE URL: http://localhost:8765/
========================================
.BASE URL: http://localhost:8765/
========================================
.BASE URL: http://localhost:8765/
========================================
- [1] body @ (0.0, 0.0) classes=[NO_CLASS] children=1
  |- [2] div @ (0.0, 0.0) classes=[NO_CLASS] children=1
     |- [3] div @ (0.0, 50.0) classes=[NO_CLASS] children=9
        |- [4] span @ (2.0, 52.0) text=u'diam a elementum,:' classes=[NO_CLASS]
        |- [5] input_text @ (2.0, 63.0) value= classes=[NO_CLASS]
        |- [6] button @ (2.0, 82.0) text=u'cancel' classes=[NO_CLASS]
        |- [7] span @ (2.0, 100.0) text=u'sed feugiat quisque:' classes=[NO_CLASS]
        |- [8] input_text @ (2.0, 111.0) value= classes=[NO_CLASS]
        |- [9] input_text @ (2.0, 130.0) value= classes=[NO_CLASS]
        |- [10] input_text @ (2.0, 149.0) value= classes=[NO_CLASS]
        |- [11] span @ (2.0, 168.0) text=u'pharetra pellentesqu...' classes=[NO_CLASS]
        |- [12] input_text @ (2.0, 179.0) value= classes=[NO_CLASS]
Clicking with click([5] input_text @ (2.0, 63.0) value= classes=[NO_CLASS])
Clicking with click([8] input_text @ (78.14, 92.0) value= classes=[NO_CLASS])
Clicking with click([5] input_text @ (2.0, 63.0) value= classes=[NO_CLASS])
Clicking with click([6] button @ (2.0, 82.0) text=u'cancel' classes=[NO_CLASS])
Clicking with click([9] button @ (2.0, 111.0) text=u'ok' classes=[NO_CLASS])
Clicking with click([6] button @ (2.0, 82.0) text=u'cancel' classes=[NO_CLASS])
.BASE URL: http://localhost:8765/
========================================
Clicking with click([4] button @ (20.0, 75.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([5] button @ (26.0, 87.0) text=u'TWO' classes=[NO_CLASS])
Clicking with click([4] button @ (64.0, 101.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([4] button @ (20.0, 113.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([5] button @ (16.0, 83.0) text=u'TWO' classes=[NO_CLASS])
Clicking with click([4] button @ (56.0, 164.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([4] button @ (82.0, 83.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([5] button @ (59.0, 109.0) text=u'TWO' classes=[NO_CLASS])
Clicking with click([4] button @ (115.0, 107.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([4] button @ (30.0, 163.0) text=u'ONE' classes=[NO_CLASS])
Clicking with click([5] button @ (113.0, 151.0) text=u'TWO' classes=[NO_CLASS])
Clicking with click([4] button @ (7.0, 166.0) text=u'ONE' classes=[NO_CLASS])
.BASE URL: http://localhost:8765/
========================================
Forward to Cathrine the email from Evy.
by: u'Evy'
to: u'Cathrine'
Send Bettine the information Lidia sent to you.
by: u'Lidia'
to: u'Bettine'
Please find the message by Patrizia, then send it to Hestia.
by: u'Patrizia'
to: u'Hestia'
Get Sharyl email and then forward it to Roz please.
dummy: 'dummy'
F

================================ FAILURES ================================
____________________ TestMiniWoBEnvironment.test_run _____________________

self = <wge.tests.miniwob.test_environment.TestMiniWoBEnvironment object at 0x104a17490>
env = <wge.miniwob.environment.MiniWoBEnvironment object at 0x104a173d0>

    def test_run(self, env):
        """Test reset and step."""
        print '=' * 40
        states = env.reset()
        print [x.utterance for x in states]
        assert all(x.utterance == 'Click the button.' for x in states)
        print [x.fields for x in states]
>       assert all(not x.fields for x in states)
E       assert False
E        +  where False = all(<generator object <genexpr> at 0x1048aebe0>)

wge/tests/miniwob/test_environment.py:66: AssertionError
_____________________ TestMiniWoBFields.test_fields ______________________

self = <wge.tests.miniwob.test_environment.TestMiniWoBFields object at 0x104dbf090>
env = <wge.miniwob.environment.MiniWoBEnvironment object at 0x104d5ae50>

    def test_fields(self, env):
        print '=' * 40
        # Training time
        states = env.reset()
        for state in states:
            print state.utterance
            print state.fields
            assert 'by' in state.fields.keys
            assert 'to' in state.fields.keys
            assert state.fields['by'] in state.utterance
            assert state.fields['to'] in state.utterance
        # Test time
        states = env.reset(mode='test')
        for state in states:
            print state.utterance
            print state.fields
>           assert not state.fields.keys
E           AssertionError: assert not ['dummy']
E            +  where ['dummy'] = dummy: 'dummy'.keys
E            +    where dummy: 'dummy' = MiniWoBState(utterance: u'Get Sharyl email and then forward it to Roz please.').fields

wge/tests/miniwob/test_environment.py:321: AssertionError
================== 2 failed, 7 passed in 42.99 seconds ===================

any idea what goes wrong?

miniwob-demos.git is not public

hi:

when trying to reproduce your work, this line failed:

git clone https://github.com/stanfordnlp/miniwob-demos.git $REPO_DIR/third-party/miniwob-demos export RL_DEMO_DIR=$REPO_DIR/third-party/miniwob-demos/

after inspection it's not public available. Will you release it?

Only works with Pytorch<=0.1.12

First of all, many thanks for all the work you put into making sure your work is reproducible! 🥇

It seems that ever since Pytorch==0.2.0 it is assumed that keepdim=False for reduction functions such as tensor.sum(). This assumption breaks a bunch of the code here... so it may be wise to specify a version in the Readme.

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.