Skip to content

junjiequ123/toposoid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Toposoid Community Edition

Toposoid is a knowledge base construction platform. Toposoid has the following features.

  • You can build a knowledge base just by entering sentences (currently only Japanese is supported).
  • If you enter the text as it is, you can search the knowledge base and obtain inference results.
  • This inferring program is designed so that developers can freely extend and replace it in their favorite programming language.

In this repository, it is published as Toposoid Community Edition. For more information -> https://toposoid.com/

Outline Drawing

Knowledge Base Image

Toposoid project dependencies

ProjectName Function Status
toposoid Root project for all Toposoid projects
toposoid-component-dispatcher-web This microservice integrates two major microservices. One is a microservice that analyzes the predicate argument structure of sentences, and the other is a microservice that makes logical inferences. Unit Test And Build Image Action
toposoid-knowledge-register-web This Microservice registers the results of predicate argument structure analysis of Japanese natural sentences in a graph database. Unit Test And Build Image Action
toposoid-sat-solver-web This microservice provides solver functionality for Boolean satisfiability problems (SAT) or similar problems (Max-SAT etc.). Test And Build
toposoid-sentence-parser-japanese-web This Microservice analyzes the predicate argument structure of Japanese sentences and outputs the result in JSON. Test And Build
toposoid-common-nlp-japanese-web This Microservice provides an NLP function that handles Japanese and outputs the result in JSON. Test And Build
toposoid-sentence-parser-english-web This Microservice analyzes dependency's structure of English sentences and outputs the result in JSON. Test And Build
toposoid-common-nlp-english-web This Microservice provides an NLP function that handles English and outputs the result in JSON. Test And Build
toposoid-deduction-admin-web This microservice provides the ability to manage multiple deductive inference logic to register, update microservices. Unit Test And Build Image Action
toposoid-deduction-unit-exact-match-web This microservice provides the ability to determine if the text you enter matches the knowledge graph exactly.   Unit Test And Build Image Action
toposoid-deduction-unit-synonym-match-web This microservice provides the ability to determine if the text you enter matches, provided that the knowledge graph and synonyms are equated. Unit Test And Build Image Action
toposoid-deduction-common This is a common library used by toposoid developer in toposoid projects. In particular, this module is used by units that perform deductive reasoning in toposoid projects. Unit Test Action
toposoid-sentence-parser-japanese This component performs predicate argument structure analysis when a Japanese sentence is given as input. Then, it outputs the information necessary for converting to a knowledge graph. Unit Test
toposoid-knowledgebase-model This library defines a basic model commonly used in toposoid projects. Header Check Action
toposoid-deduction-protocol-model This library defines a basic model commonly used in toposoid projects. Especially these are used in deductive logic. Header Check Action
toposoid-common This is a common library used by toposoid developer in toposoid projects. Unit Test
scala-data-accessor-neo4j-web This Microservice get information from Neo4J graph database. outputs the result in JSON. Unit Test And Build Image Action
scala-data-accessor-neo4j The main implementation of this project is the neo4j driver Wrapper. Unit Test Action
scala-common This is a common library used by Linked Ideal LLC. in Scala projects. Header Check Action

Requirements

  • Docker version 20.10.x, or later
  • docker-compose version 1.22.x

Recommended environment

  • Required: at least 8GB of RAM (The maximum heap memory size of the JVM is set to 6G (Application: 4G, Neo4J: 2G))
  • Required: 65G or higher of HDD

Setup

docker-compose up -d

It takes more than 20 minutes to pull the Docker image for the first time.

Usage

# Regist knowledge
# Japanese
curl -X POST -H "Content-Type: application/json" -d '{"knowledgeList":[{"sentence":"案ずるより産むが易し。", "lang": "ja_JP", "extentInfoJson":"{}", "isNegativeSentence":false}]}' http://localhost:4444/regist/regist
# English
curl -X POST -H "Content-Type: application/json" -d '{"knowledgeList":[{"sentence":"Our life is our art.", "lang": "en_US", "extentInfoJson":"{}", "isNegativeSentence":false}]}' http://localhost:4444/regist/regist

Try accessing http://localhost:7474 in your browser. You will be able to see the data you registered from the API. as follows スクリーンショット 2022-01-08 19 31 10

# Deduction
# Japanese
curl -X POST -H "Content-Type: application/json" -d '{"premise":[],"claim":[{"sentence":"案ずるより産むが易し。", "lang": "ja_JP", "extentInfoJson":"{}", "isNegativeSentence":false}]}' http://localhost:4444/deduction/analyze
# English
curl -X POST -H "Content-Type: application/json" -d '{"premise":[],"claim":[{"sentence":"Our life is our art.", "lang": "en_US", "extentInfoJson":"{}", "isNegativeSentence":false}]}' http://localhost:4444/deduction/analyze

2021-10-05 12 12 08

Deduction's Example

An example of a logic puzzle called a liar game

There are three people, A, B, and C, two honest people and the other one is a liar. And all three know who is honest and who is a liar. Here, an honest person is a person who always says the truth, and a liar is a person who always says the opposite of the truth. At this time, the following testimonies of A, B, and C were obtained.

  • A's testimony: C is a liar.
  • B's testimony: A is honest.
  • C's testimony: B is a liar. Based on these testimonies, follow these steps to determine who is a liar.

This problem can be defined by one regulation and three hypothesis.

regulation

  • (A AND B AND NOT C) OR (A AND NOT B AND C) OR (NOT A AND B AND C)
Step Premise & Claim LogicTree
1
2
3

hypothesis

  • A → NOT C
  • B → A
  • C → NOT B
Step Premise & Claim LogicTree
4
5
6

result

Press the Analyze button to start logical inference.

Note

  • If you want to run in a remote environment or a virtual environment, change PRIVATE_IP_ADDRESS in docker-compose.yml according to your environment.
  • The memory allocated to Neo4J can be adjusted with NEO4J_dbms_memory_heap_max__size in docker-compose.yml.
  • Services provided by Toposoid are accessible on port 4444

License

Toposoid Community Edition is an open source product licensed under Apache-2.0 License. But, the license of Neo4J used by Toposoid Community Edition as a graph database is GPLv3. Please be careful. If you use Neo4j Enterprise Edition, this limitation is removed. Currently, we are working on making the licensed Topsoid Enterprise Edition including the above available soon.

Author

Thank you!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published