Skip to content

Automating the Bechdel test and its variants for feminine representation in movies with AI

License

Notifications You must be signed in to change notification settings

dataforgoodfr/bechdelai

Repository files navigation

BechdelAI

Measurement and automation of the Bechdel test, female (under)representation and representation inequalities in cinema and audiovisual media

This repo is under active development, the documentation may not be up to date

Structure of the repo

- bechdelai         ----- Python code as a library
- docs              ----- Documentation
- data              ----- Reusable datasets
- notebooks         ----- Experiments
    - video         ----- Experiments on video data
    - audio         ----- Experiments on audio data
    - posters       ----- Experiments on posters
    - nlp           ----- Experiments on nlp

Documentation

Developers

mkdocs serve        ---- launch documentation locally
poetry build        ---- build package locally
poetry publish      ---- publish package on PyPi

Installing pre-commit

To install pre-commit, you can use these command lines at the root of this repo:

pip install pre-commit
pre-commit install

Then when you'll use git commit it will automatically run the following checks : BechdelAI pre-commit hooks.

Important: if a file is updated by one hook you need to add it again before reusing git commit.

More details in the pre-commit documentation

Golden rules & best practices

  • Use type annotations as much as possible (see tutorial here)
  • Use Google style docstrings (you can use Visual Studio Code extension)
  • Documentation of all functions and classes is done using mkdocstrings https://mkdocstrings.github.io/usage/

Get movies from Allociné / TMDB (may be deprecated)

Install

pip install -e .

Run with cli

$ scrap-movies --help
Usage: scrap-movies [OPTIONS]

  CLI for scraping movies from Allociné and TMDB.

  It follows these steps:

  1. Extract N movies from Allociné

  2. Find corresponding TMDB id for each movie

  3. Get data for each movie with TMDB API: metadata, crew and cast

  4. Save csv results

Options:
  -n, --movies-number TEXT  Number of movies wanted.  [required]
  -p, --path TEXT           Path where to save csv results.  [required]
  --sort-by TEXT            How to sort movies in Allociné pages. Available
                            choices: ['popularity', 'alphabetic',
                            'press_note', 'public_note']
  --genre TEXT              Filter for genre.
  --year TEXT               Filter for year.
  --country TEXT            Filter for country.
  -v, --verbose BOOLEAN     The person to greet.
  --help                    Show this message and exit.

Examples

# Scrap first current most popular movie in Allociné
scrap-movies -n 1 -p .
# Scrap top 15 most popular movies in Allociné in 2018 from France
scrap-movies -n 15 -p . --year 2018 --country France
# Scrap top 50 with the best public notes
scrap-movies -n 50 -p . --sort-by public_note

About

Automating the Bechdel test and its variants for feminine representation in movies with AI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages