texas

command module
v0.0.0-...-3a643b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

README

Turing test EXtended Architecture (TEXA): A method for interacting, evaluating and assessing AI

Build Status

TEXA is a novel framework backed by a mathematical oriented theory(Texa Theory, refer to /texa-docs) for interacting, evaluating and assessing AIs.

LIBRARIES USED:

The system uses a number of open source projects to work properly:

  • texalib - Special Math library written from scratch for TEXA
  • texajson - Dedicated JSON interpreter library that serves as interface to native Datastore.
  • JS - evented I/O for the backend
  • jQuery - duh
  • ElizaBOT-JS - Javascript implementation of the ELIZA specification by Weizenbaum, 1966. Special thanks to Landsteiner!

Installation:

Go:

TEXA is written in Go v1.7+. If you don't have a Go development environment, please set one up.

Redis:

TEXA uses Redis to store all the mathematical data used by the texalib package, depended by the TEXA API. You can install redis and learn more about redis here.

MongoDB:

TEXA persists all your chat history in a local MongoDB instance, keeping your interrogation data private. You can install MongoDB and learn more about MongoDB here.

Build on a local OS:

Make sure your go version is 1.7+

$ go version

Move to your

$ cd $GOPATH/src/

Clone the texa project from github

$ git clone https://github.com/TexaProject/texa.git

Navigate to the texa project

$ cd $GOPATH/src/texa/

Run make file, by the following order

   make install
   make test
   make run

follow the below steps, to set up your local git config to contribute

git remote add upstream https://github.com/TexaProject/texa.git
# or: git remote add upstream git@github.com:TexaProject/texa.git

# Never push to upstream master
git remote set-url --push upstream no_push

# Confirm that your remotes make sense:
git remote -v

Contribute

Get your local master up to date:

git fetch upstream
git checkout master
git rebase upstream/master

Branch from it:

git checkout -b mytexa

Then edit code on the mytexa branch.

Validate your changes before raise PR

   make install
   make test
   make fmt
   #before you push your changes, to format the code base

Unit test and bench mark test:

Run unit test on package level

go test texa/storage

Run Benchmark test on package level

go test go test texa/storage -bench=.

Run a unit test, navigate to package

go test -run=TestAddtoMongo

Run a benchmark test

go test -run=BenchmarkAddtoMongo -bench=.

Profiling Texa App:

Profiling Texa App by using Go pprof package To use pprof, link this package into app:

import _ "net/http/pprof"

Pprof:

pprof is a tool for visualization and analysis of profiling data. Install the belos dependency to build the pprof tool

go get -u github.com/google/pprof

Pprof sample:
Profiling http request:

Testing the sample load by manual script file.

   for i in {1..1000}; do curl -X POST http://localhost:3030/texa -d IntName=pan -d scoreArray=[0,1,1] 
   -d SlabName=sports -d slabSequence=[sports,sports,sports] 
   -d chatHistory=[hi,hello! how can I help you,how is weather today, do you wanna know more,yes,its nice talking to you] -d timeStamp=32465466754; done

Befor run the above script start to monitor the profiling of Texa app by

go tool pprof http://localhost:3030/debug/pprof/profile?seconds=30

Profiling creates a pprof file eg : pprof.main.samples.cpu.01.pb.gz Visualize and analysis by pprof tool

pprof -http=:6060 pprof.main.samples.cpu.01.pb.gz

It starts pprof tool app on port 6060 and visualizing the profiling data including flame graph

Profiling benchmark test:

Below command will execute the benchmark test, and it will create a binary storage.test and creates profile.out file.

go test -run=BenchmarkAddtoMongo -bench=.

Then, visualize and analysis the profiling data by pprof tool, pprof starts a service in 8081.

pprof -http=localhost:8081 storage.test profile.out

TODO (Future Work)

  • Stability offered only for Unit Test Instance. Can support multiple cases without SLA.
  • Lacks complete support for non-Eliza AIs(non-JS REF).
  • APIs can be exposed to build use-cases such as ranking apps etc.
  • Feel free to try new ideas!

License

Apache 2.0 on the demonstrated work. Derived work carry respective Licenses. Please refer the links.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
package storage package to store the data in mongo, this package creates a session and persists the session, to contact with mongo.
package storage package to store the data in mongo, this package creates a session and persists the session, to contact with mongo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL