This Word Does Not Exist: Unlocking the Art of Imaginary Lexicons

Aug 1, 2023 | Data Science

Welcome to the whimsical world of word creation! If you’ve ever felt the urge to invent your own dictionary filled with creative, made-up terms and their definitions, you’re in the right spot. This blog will guide you on how to use the “This Word Does Not Exist” project, a brilliant initiative allowing you to train a version of GPT-2 to fabricate words, definitions, and examples from scratch. Let’s dive into how you can generate your own unique vocabulary!

Generating Words

To get started with generating words, you need to follow several steps. It’s like embarking on a culinary adventure where you’ll create new flavors (words) from basic ingredients (your code). Imagine each word you generate as a unique recipe, crafted to tickle the fancy of language lovers everywhere!

Setting Up Your Environment

  • Make sure you have Python installed.
  • Install the necessary dependencies by referring to the following link: python deps.

Utilizing the Pre-trained Models

You’ll need to utilize several pre-trained model files to generate words:

Using the Word Generator

You will utilize the WordGenerator class to create words effortlessly. Here’s how this works, using an analogy of a chef preparing a gourmet dish:

  • First, as a chef gathers their ingredients, you’ll initiate the word generator with necessary paths:
  • from title_maker_pro.word_generator import WordGenerator
    
    word_generator = WordGenerator(
        device='cpu',
        forward_model_path='somepath1',
        inverse_model_path='somepath2',
        blacklist_path='blacklist',
        quantize=False,
    )
  • Next, much like adding spices to create a unique flavor, you can generate a word from scratch:
  • print(word_generator.generate_word())
  • And for that final touch, you can even conjure up a definition for a word you’ve just made:
  • print(word_generator.generate_definition('glooberyblipboop'))

Training a New Model

If you’re feeling a bit adventurous and want to train your own model, you’ll first need a dictionary. This part of the process resembles gathering ingredients from different sources:

After gathering your ingredients, you’ll run the master training script with each source, much like mixing various components to create a new dish!

python train.py

Website Development Instructions

Finally, if you’re keen on developing a website around your word creations or settings, here’s what you need to do:

  • Navigate into the website directory: cd .website
  • Install the required dependencies: pip install -r requirements.txt
  • Run the server: pip install aiohttp-devtools followed by adev runserver
This is akin to setting up your restaurant to showcase the delightful dishes you’ve created!

Troubleshooting Tips

If you run into any complications during the process, here are some troubleshooting tips:

  • Ensure all paths to model files are correctly set.
  • Check your environment settings to confirm all dependencies have been installed successfully.
  • Verify that the dictionary you are extracting is correctly formatted and accessible.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox