If you want to use knowledge graphs in your project, check out GPT Index.
GraphGPT converts unstructured natural language into a knowledge graph. Pass in the synopsis of your favorite movie, a passage from a confusing Wikipedia page, or transcript from a video to generate a graph visualization of entities and their relationships.
Successive queries can update the existing state of the graph or create an entirely new structure. For example, updating the current state could involve injecting new information through nodes and edges or changing the color of certain nodes.
The current few-shot prompt guides GPT-3 in accurately understanding the JSON formatting GraphGPT requires for proper rendering. You can see the entire prompt in public/prompts/xxx.prompt
. A major issue at the moment is latency. Due to the nature of OpenAI API calls, it takes up to 20 seconds to receive a response.
- Take csv files as input
- Generate a graph from the csv files
- Allow users to query the graph
- Allow users to update the graph
- Allow users to change the color of nodes
- Allow users to change the color of edges
- Allow users to export the graph as a triple class
- When the input is empty and users click "Generate", the default or random graph will be displayed
- The Graph zone is not scrollable
- The graph is not responsive to the size of the window.
- Stateless and Stateful components require different formatting due to stop symbol.
- Run
npm install
to download required dependencies (currently just react-graph-vis). - Make sure you have an OpenAI API key. You will enter this into the web app when running queries.
- Run
npm run start
. GraphGPT should open up in a new browser tab.
Prompts are located in the public/prompts
folder.
Modify the prompt to make GraphGTP works better!
Obtain all csv files from AccreditationExplorer
File Name | Content | Structure |
---|---|---|
activity.csv | Unit Activities |
|
advisable_prior_study.csv | Unit Prior Studies Prerequisites |
|
AQF.csv | Unit Outcomes and AQF ID |
|
cbok_end.csv | End Level CBoK (E.g: abstraction) |
|
cbok_sub.csv | Sub Level CBoK (E.g: problem solving) |
|
cbok_top.csv | Top Level CBoK (E.g: General, Essential) | Two lines string containing CBoK top level knowledge areas |
course.csv | Program Course Information |
|
MIT_AQF_Outcome_cat.csv | AQF categories for MIT |
|
MIT_AQF_Outcomes .csv | AQF outcomes for MIT |
|
incompatibilities.csv | Units Incompatibilites |
|
outcome.csv | Unit Outcomes |
|
prer_course.csv | Course Prerequisites for Units |
|
prer_program.csv | Programming Units Prerequisites |
|
prer_unit.csv | Unit to Unit Prerequisites |
|
role.csv | Units Role in Program Course |
|
unit.csv | Units Information |
|
unit_activity_cbok.csv | Unit-Activities-CBoK Mappings |
|
First prompt
unitCode,courseCode\nCITS4009,62510\nCITS4009,62530
Second prompt
unitCode,title,credit,programmingBased,availabilities\nCITS4009,"Computational Data Analysis",6,1,"Semester 2 2021, Crawley (Face to face); Semester 2 2021, Crawley (Online-TT) [Contact hours: n/a];"
Third prompt
courseCode,title,abbreviation,CRICOSCode,degree\n62510,Master of Information Technology,MIT,083866G,PG\n62530,Master of Data Science,MDSc,093310E,PG