Skip to content

Latest commit

 

History

History
 
 

core

The core library contains the following files:

  • agents.py: this file contains a few basic agents which can be extended by your own model
    • Agent: base class for all other agents, implements the act() method which receives an observation table and returns a table in response
    • Teacher: child of Agent, also implements the report method for returning metrics. Tasks implement the Teacher class
    • MultiTaskTeacher: creates a set of teachers based on a "task string" passed to the Teacher, creating multiple teachers within it and alternating between them
    • create_task_teacher: instantiate a teacher from a given task string (e.g. 'babi:task:1' or 'squad')
  • build_data.py: basic utilities for setting up data for tasks. you can override if your filesystem needs different functionality.
  • dict.py: contains code for building general NLP-style dictionaries from observations
    • DictionaryAgent: agent which tracks the index and frequency of words in a dictionary, and can parse a sentence into indices into its dictionary or back
  • metrics.py: computes evaluation metrics, e.g. ranking metrics, etc.
  • params.py: uses argparse to interpret command line arguments for ParlAI
  • teachers.py: contains teachers that deal with dialogue-based tasks, as well as data classes for storing data
    • FixedDialogTeacher: base class for a teacher that utilizes fixed data
    • DialogTeacher: base class for a teacher doing dialogue with fixed chat logs
    • ParlAIDialogTeacher: a teacher that implements a simple standard text format for many tasks (non-visual tasks only)
  • thread_utils.py: utility classes/functions for use in Hogwild multithreading (multiprocessing)
    • SharedTable: provides a lock-protected, shared-memory, dictionary-like interface for keeping track of metrics
  • worlds.py: contains a set of basic worlds for tasks to take place inside
    • World: base class for all other worlds, implements parley, shutdown, __enter__, and __exit__
    • DialogPartnerWorld: default world for turn-based two-agent communication
    • MultiAgentDialogWorld: round-robin turn-based agent communication for two or more agents
    • HogwildWorld: default world for setting up a separate world for every thread when using multiple threads (processes)