Giter Site home page Giter Site logo

viz_embeddings's Introduction

viz_embeddings

Embeddings projections for TensorFlow Projector using HuggingFace Transformers.

Example 1, Example 2

Requirements

The only requirements are: HuggingFace and NTLK.

Using pip :

 pip install -r requirements.txt

Usage

  1. Run extract_embbedings to produce embeddings.tsv and vocab.tsv

    from extract import extract_embeddings
    
    extract_embeddings(text, model_name, level_name, aggr_func=torch.mean, filter_func=lambda x: len(x) >= 3, unique = True, doc_stride=1, do_lower=False)

    Args:

    text (str): input text

    model_name (str): Hugging Face model name

    level_name (str): text segmentation level name

    aggr_func (func): function to aggregate tensor embbedings

    filter_func (func): filter vocabulary level function

    unique (bool): if terms on level_name should be unique

    do_lower (bool): when unique = True, whether considere cased

  2. View or Publish

viz_embeddings's People

Contributors

ju-resplande avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.