GithubHelp home page GithubHelp logo

mshojaei77 / prompt-scraper Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 0.0 122 KB

Effortlessly collect and transform Midjourney prompts into a versatile language model dataset.

Home Page: https://huggingface.co/datasets/mshojaei77/Midjourney-Art-Prompts

Python 100.00%
midjourney prompt scraper

prompt-scraper's Introduction

Midjourney Prompt Scraper

Overview

This project involves the extraction, processing, and transformation of Midjourney prompts obtained from https://prompthero.com/midjourney-prompts. The goal is to create a dataset suitable for training language models, specifically tailored for image generation prompts.

Project Structure

The project consists of four Python scripts:

  1. link_extracter.py

    • Description: Scrapes prompt links from the Midjourney prompts website using Selenium and BeautifulSoup.
    • Dependencies: csv, BeautifulSoup, selenium
  2. text_extracter.py

    • Description: Fetches text content from the extracted prompt links, considering rate-limiting and retries.
    • Dependencies: csv, requests, BeautifulSoup, time, HTTPAdapter, Retry
  3. addsubject.py

    • Description: Identifies main subjects in the prompts using spaCy and NLTK, then replaces placeholders with these subjects.
    • Dependencies: csv, spacy, nltk
  4. convert2json.py

    • Description: Converts the processed CSV data into a JSON format suitable for training a language model.
    • Dependencies: csv, json

Usage

  1. Clone the Repository:

    git clone [repository_url]
    cd Midjourney-Prompts-Project
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Run the Scripts:

    python link_extracter.py
    python text_extracter.py
    python addsubject.py
    python convert2json.py
  4. Generated Files:

    • prompt_links.csv: Contains the extracted prompt links.
    • partial_prompt_texts.csv: Contains text extracted from the prompt links.
    • prompts_with_subject.csv: Contains prompts with identified subjects.
    • prompts_with_subject.jsonl: JSON file suitable for language model training.

Hugging Face Dataset Card

Explore the dataset on Hugging Face: Midjourney Art Prompts

Dataset Usage

The generated JSON file is specifically formatted for fine-tuning models using Hugging Face's Transformers library, such as ChatGPT. The CSV files, on the other hand, can be used for training or fine-tuning other Language Model Models (LLMs).

Acknowledgments

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

prompt-scraper's People

Contributors

mshojaei77 avatar

Stargazers

Jack avatar  avatar  avatar  avatar Richard Fortune avatar Jonathan Hyde avatar zen avatar  avatar Hossein Molaei avatar Mohammadhadi Farokhi avatar  avatar AmirHosein Rajabi avatar

Watchers

 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.