Giter Site home page Giter Site logo

text-based-game-framework-using-drl-and-nlp's Introduction

Text-based Games using Deep Reinforcement Learning

Tensorflow implementation of Language Understanding for Text-based Games using Deep Reinforcement Learning. The original code of author can be found here.

Prerequisites

Usage

The code implements a framework for interacting with a text-based game environment using Deep Reinforcement Learning (DRL) and Natural Language Processing (NLP).

Core Functionalities:

Interaction with Text-based Game: Connects to the game environment using sockets (zmq). Sends commands (actions) to the game and receives responses (text descriptions, rewards). Parses the game output to extract relevant information like room descriptions, quest details, and rewards. State Representation: Processes the textual information from the game using NLP techniques. Converts the processed text into a numerical representation (vector) suitable for DRL algorithms. Offers different conversion methods like bag-of-words (BOW), bigrams, or ordered lists depending on the chosen approach (controlled by RECURRENT variable). Action Space: Defines a set of possible actions the agent can take in the game (e.g., move, look, interact). Reward System: Assigns rewards based on the agent's actions and the game's response. Higher rewards for completing quests or achieving goals. Lower rewards for neutral actions or penalties for invalid actions. DEFAULT_REWARD, JUNK_CMD_REWARD, and quest-specific rewards are defined. Quest Management: Generates random quests for the agent to complete. Tracks completed quests using checklists. Creates misleading quests for a more complex learning environment. Additional Features:

Symbol Mapping: Creates a mapping between words encountered in the game and unique numerical IDs (symbols). This allows efficient representation of textual information as vectors. Logging and Debugging: Provides functions for logging game interactions and rewards. Enables debugging with DEBUG flag for printing additional information. Customization: Allows customizing the number of actions, objects, and maximum steps per episode. Supports different state representation methods through vector_function. Overall, this code serves as a foundation for building an agent that can learn to play text-based games through Deep Reinforcement Learning.

References

text-based-game-framework-using-drl-and-nlp's People

Contributors

adititakale01 avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

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.