Giter Site home page Giter Site logo

pair-code / farsight Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 2.0 21.51 MB

In situ interactive widgets for responsible AI ๐ŸŒฑ

Home Page: https://pair-code.github.io/farsight/

License: Apache License 2.0

HTML 1.51% CSS 7.85% SCSS 13.48% TypeScript 72.71% JavaScript 1.67% Python 2.77% Shell 0.01%
ai ai-safety chatgpt chrome-extension gemini gemini-pro gpt-4 jupyter-notebook llm notebook

farsight's Introduction

Farsight Farsight logo.

Github Actions Status license npm pypi Open In Colab arxiv badge 10.1145/3613904.3642335

In situ interactive widgets for responsible AI ๐ŸŒฑ

๐Ÿš€ Farsight Demo ๐Ÿ“บ Demo Video ๐Ÿ“– Research Paper

What is Farsight?

Farsight is a collection of in situ interactive widgets that help large language model (LLM) prompt creators to envision potential harms associated with their AI applications. With a novel in situ design, contextual AI incident feed, and human-AI collaborative harm envisioning, Farsight empowers prompt creators with diverse backgrounds to be more mindful of responsible AI during early AI prototyping.

Widgets
1๏ธโƒฃ Alert Symbol Alert users with potential risks of their prompts and AI applications
2๏ธโƒฃ Incident Panel Relevant cautionary tales for users' AI applications
3๏ธโƒฃ Use Case Panel LLM-generated diverse use cases, stakeholders, and harms
4๏ธโƒฃ Harm Envisioner Human-AI collaborative harm envisioning tool
Distributions
๐Ÿ“ฆ Live Demo Try Farsight with Gemini Pro and GPT-3.5
๐Ÿ“ฆ Chrome Extension Google AI Studio support
๐Ÿ“ฆ Python Package Computational notebook support (Jupyter, Colab, VS Code notebook)

Features

Demo Video

Click to see the demo video!
farsight-demo-video.mp4

Get Started

Live Demo

For a live demo, visit: https://PAIR-code.github.io/farsight/.

Computational Notebook

If you use computational notebooks (e.g., Jupyter Notebook, JupyterLab, Google Colab, VS Code Notebook), you can easily use Farsight via its Python Package. We recommend using StickyLand to enable sticky cells.

Visit this Colab Notebook for a demo.

# Install Farsight
!pip install farsight

prompt = "Translate a sentence from English to French."

# Alert Symbol
farsight.symbol(prompt)

# Awareness Sidebar
farsight.sidebar(prompt)

# Harm Envisioner
farsight.envision(prompt)

Google AI Studio

If you use Google AI Studio to prototype AI applications, you can manually install our Chrome Extension package from the latest release.

  1. Download farsight.crx
  2. Open chrome://extensions/ in Chrome
  3. Drag farsight.crx into the page
  4. Visit Google AI Studio and you will see Farsight :)

Integrating Farsight into Prompting Tools

If you are a developer of web-based prompting tools, you can easily integrate different Farsight widgets into your tool regardless of your development stacks (e.g., React, Svelte, or Vanilla JS).

First, install Farsight's JavaScript package:

npm install --save-dev @xiaohk/farsight

Then, you can use Farsight as Web Components.

JavaScript:

import '@xiaohk/farsight';
import {
  FarsightContainer,
  FarsightContainerLite,
  FarsightContainerSignal
} from '@xiaohk/farsight';

HTML:

<farsight-container-signal
  prompt="Translate a sentence from English to French"
></farsight-container-signal>

Developing Farsight

Clone or download this repository:

git clone [email protected]:PAIR-code/farsight.git

Install the dependencies:

npm install

Then run Farsight:

npm run dev

Navigate to localhost:3000. You should see Farsight running in your browser :)

How is Farsight Built?

Farsight is a collection of Web Components that developers can easily integrate into their web apps regardless of their development stack (e.g., Angular, React, Svelte). Farsight is written in TypeScript using LIT Element as a framework. Farsight uses D3.js to implement the interactive tree visualization. The relevant AI incidents are from the AI Incident Database, and the harm category is from the sociotechnical harm taxonomy. The computational notebook support is enabled by NOVA.

Credits

Led by Jay Wang, Farsight is a result of a collaboration between researchers from Google Research, Georgia Tech, eBay, and Emory University. Farsight is created by Jay Wang, Chinmay Kulkarni, Lauren Wilcox, Mike Terry, and Michael Madaio.

Citation

To learn more about Farsight, please read our research paper (published at CHI 2024).

@inproceedings{wangFarsightFosteringResponsible2024,
  title = {Farsight: {{Fostering Responsible AI Awareness During AI Application Prototyping}}},
  booktitle = {{{CHI Conference}} on {{Human Factors}} in {{Computing Systems}}},
  author = {Wang, Zijie J. and Kulkarni, Chinmay and Wilcox, Lauren and Terry, Michael and Madaio, Michael},
  year = {2024}
}

License

Contact

If you have any questions, feel free to open an issue or contact Jay Wang.

farsight's People

Contributors

jameswex avatar xiaohk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.