Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing

This project welcomes contributions and suggestions. Most contributions require you to
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
and actually do, grant us the rights to use your contribution. For details, visit
https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
38 changes: 12 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Project
# Transformer Visualizations
Investigations on Transformer Visualizations by the Aether Prototyping and Incubation team.

> This repo has been populated by an initial template to help get you started. Please
> make sure to update the content to build a great experience for community-building.
## Getting Started

As the maintainer of this project, please make a few updates:
### Development Environment Setup
- `python -m pip install --upgrade pip`
- `pip install -r requirements.txt --cache-dir <path-to-pip-cache-dir>` (The `cache-dir` parameter is optional).
- `pip install -e .`
- `npm install`
- `npm run build`

- Improving this README.MD file to provide a great experience
- Updating SUPPORT.MD with content about this project's support experience
- Understanding the security reporting process in SECURITY.MD
- Remove this section from the README
### Running
`PERSPECTIVE_API_KEY=<perspective-api-key> GPT2_MODEL_VERSION=<gpt2-model-version> NUM_RETURN_SEQUENCES=<number-of-return-sequences> TRANSFORMERS_CACHE=<path-to-transformers-cache> FLASK_APP=transformerviz/server.py flask run --host 0.0.0.0 --port 5000` (The `TRANSFORMERS_CACHE` environment variable is optional).
- Point your browser to port 5000 of the server on which the app is running.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
Expand All @@ -25,25 +28,8 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.


## Development Environment Setup

- `pip install pip upgrade`
- `pip install -r requirements.txt --cache-dir <path-to-pip-cache-dir>` (The `cache-dir` parameter is optional).
- `pip install -e .`
- `npm install`
- `npm run build`


## Running

- `PERSPECTIVE_API_KEY=<perspective-api-key> GPT2_MODEL_VERSION=<gpt2-model-version> NUM_RETURN_SEQUENCES=<number-of-return-sequences> TRANSFORMERS_CACHE=<path-to-transformers-cache> FLASK_APP=transformerviz/server.py flask run --host 0.0.0.0 --port 5000` (The `TRANSFORMERS_CACHE` environment variable is optional).
- Point your browser to port 5000 of the server on which the app is running.

25 changes: 0 additions & 25 deletions SUPPORT.md

This file was deleted.

5 changes: 5 additions & 0 deletions development/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
-->

<html>
<head>
<style>
Expand Down
3 changes: 3 additions & 0 deletions frontend/MainContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React, { useEffect, useState } from "react";
import { bindActionCreators } from "redux";
import { connect } from 'react-redux';
Expand Down
3 changes: 3 additions & 0 deletions frontend/actions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { makeGetCall, makePostCall } from "./api";


Expand Down
3 changes: 3 additions & 0 deletions frontend/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import axios from 'axios';

var apiServiceEnvironment = window["API_SERVICE_ENVIRONMENT"];
Expand Down
5 changes: 5 additions & 0 deletions frontend/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*/

html {
height: 100%;
}
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/InteractiveText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React from "react";
import TextRecord from "../models/TextRecord";
import AnalyzedText from "../models/AnalyzedText";
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/PerspectiveScoresBarChart.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React, { Component } from "react";
import ReactDOM from "react-dom";
import * as d3 from "d3";
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/PerspectiveScoresSpiderChart.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React, { Component } from "react";
import ReactDOM from "react-dom";
import * as d3 from "d3";
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/TextDetailedAnalysis.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React from "react";
import TextRecord from "../models/TextRecord";
import AnalyzedText from "../models/AnalyzedText";
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/TextGenerationControl.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React, { FunctionComponent } from "react";
import ReactDOM from "react-dom";
import { Fabric } from "office-ui-fabric-react/lib/Fabric";
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/TextGenerationResults.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React from "react";
import { ComboBox, Dropdown, IComboBoxOption, IDropdownOption, Stack } from "office-ui-fabric-react"
import TextRecord from "../models/TextRecord";
Expand Down
3 changes: 3 additions & 0 deletions frontend/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
Expand Down
3 changes: 3 additions & 0 deletions frontend/models/AnalyzedText.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

class AnalyzedText {
text: string;
id: number;
Expand Down
3 changes: 3 additions & 0 deletions frontend/models/TextRecord.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import AnalyzedText from "./AnalyzedText";

class TextRecord {
Expand Down
3 changes: 3 additions & 0 deletions frontend/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import AnalyzedText from "./models/AnalyzedText";
import TextRecord from "./models/TextRecord";

Expand Down
Loading