Skip to content

Commit

Permalink
Merge pull request #1044 from semi-technologies/feature/contextual_cl…
Browse files Browse the repository at this point in the history
…assification

Feature/contextual classification
  • Loading branch information
etiennedi committed Dec 5, 2019
2 parents 0f09bf0 + ed89483 commit 1258419
Show file tree
Hide file tree
Showing 18 changed files with 830 additions and 208 deletions.
2 changes: 1 addition & 1 deletion adapters/handlers/rest/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions adapters/handlers/rest/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker-compose-esonly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
environment:
LOG_LEVEL: debug
SCHEMA_PROVIDER_URL: etcd:2379
OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.99
OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.95
etcd:
image: gcr.io/etcd-development/etcd:v3.3.8
ports:
Expand Down
122 changes: 62 additions & 60 deletions docker-compose/runtime/en/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,62 @@
version: '3.4'
services:
weaviate:
image: semitechnologies/weaviate:0.21.3
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
- --config-file
- config.yaml
depends_on:
- esvector
restart: on-failure:0
ports:
- 8080:8080
volumes:
- ./config.yaml:/config.yaml
contextionary:
image: semitechnologies/contextionary:en0.10.0-v0.4.2
ports:
- 9999:9999
environment:
SCHEMA_PROVIDER_URL: etcd:2379
OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.75
etcd:
image: gcr.io/etcd-development/etcd:v3.3.8
ports:
- 2379:2379
entrypoint: /usr/local/bin/etcd
command:
- --name
- s1
- --data-dir
- /etcd-data
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://0.0.0.0:2379
- --listen-peer-urls
- http://0.0.0.0:2380
- --initial-advertise-peer-urls
- http://0.0.0.0:2380
- --initial-cluster
- s1=http://0.0.0.0:2380
- --initial-cluster-token
- tkn
- --initial-cluster-state
- new
esvector:
image: semitechnologies/esvector:7.1.0
environment:
xpack.security.enabled: 'false'
ES_JAVA_OPTS: -Xms500m -Xmx500m
discovery.type: single-node
ports:
- 9201:9200
- 9301:9300
---
services:
contextionary:
environment:
OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.75
SCHEMA_PROVIDER_URL: "etcd:2379"
image: "semitechnologies/contextionary:en0.10.0-v0.4.2"
ports:
- "9999:9999"
esvector:
environment:
ES_JAVA_OPTS: "-Xms500m -Xmx500m"
discovery.type: "single-node"
xpack.security.enabled: "false"
image: "semitechnologies/esvector:7.1.0"
ports:
- "9201:9200"
- "9301:9300"
etcd:
command:
- "--name"
- "s1"
- "--data-dir"
- "/etcd-data"
- "--listen-client-urls"
- "http://0.0.0.0:2379"
- "--advertise-client-urls"
- "http://0.0.0.0:2379"
- "--listen-peer-urls"
- "http://0.0.0.0:2380"
- "--initial-advertise-peer-urls"
- "http://0.0.0.0:2380"
- "--initial-cluster"
- "s1=http://0.0.0.0:2380"
- "--initial-cluster-token"
- "tkn"
- "--initial-cluster-state"
- "new"
entrypoint: "/usr/local/bin/etcd"
image: "gcr.io/etcd-development/etcd:v3.3.8"
ports:
- "2379:2379"
weaviate:
command:
- "--host"
- "0.0.0.0"
- "--port"
- "8080"
- "--scheme"
- "http"
- "--config-file"
- "config.yaml"
depends_on:
- "esvector"
image: "semitechnologies/weaviate:0.21.4"
ports:
- "8080:8080"
restart: "on-failure:0"
volumes:
- "./config.yaml:/config.yaml"
version: "3.4"

134 changes: 68 additions & 66 deletions docker-compose/runtime/nl/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
version: '3.4'
services:
weaviate-playground:
image: semitechnologies/weaviate-playground:latest
depends_on:
- weaviate
ports:
- 80:80
weaviate:
image: semitechnologies/weaviate:0.21.3
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
- --config-file
- config.yaml
depends_on:
- esvector
restart: on-failure:0
ports:
- 8080:8080
volumes:
- ./config.yaml:/config.yaml
contextionary:
image: semitechnologies/contextionary:nl0.10.0-v0.4.2
ports:
- 9999:9999
environment:
SCHEMA_PROVIDER_URL: etcd:2379
OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.75
etcd:
image: gcr.io/etcd-development/etcd:v3.3.8
ports:
- 2379:2379
entrypoint: /usr/local/bin/etcd
command:
- --name
- s1
- --data-dir
- /etcd-data
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://0.0.0.0:2379
- --listen-peer-urls
- http://0.0.0.0:2380
- --initial-advertise-peer-urls
- http://0.0.0.0:2380
- --initial-cluster
- s1=http://0.0.0.0:2380
- --initial-cluster-token
- tkn
- --initial-cluster-state
- new
esvector:
image: semitechnologies/esvector:7.1.0
environment:
xpack.security.enabled: 'false'
ES_JAVA_OPTS: -Xms500m -Xmx500m
discovery.type: single-node
ports:
- 9201:9200
- 9301:9300
---
services:
contextionary:
environment:
OCCURRENCE_WEIGHT_LINEAR_FACTOR: 0.75
SCHEMA_PROVIDER_URL: "etcd:2379"
image: "semitechnologies/contextionary:nl0.10.0-v0.4.2"
ports:
- "9999:9999"
esvector:
environment:
ES_JAVA_OPTS: "-Xms500m -Xmx500m"
discovery.type: "single-node"
xpack.security.enabled: "false"
image: "semitechnologies/esvector:7.1.0"
ports:
- "9201:9200"
- "9301:9300"
etcd:
command:
- "--name"
- "s1"
- "--data-dir"
- "/etcd-data"
- "--listen-client-urls"
- "http://0.0.0.0:2379"
- "--advertise-client-urls"
- "http://0.0.0.0:2379"
- "--listen-peer-urls"
- "http://0.0.0.0:2380"
- "--initial-advertise-peer-urls"
- "http://0.0.0.0:2380"
- "--initial-cluster"
- "s1=http://0.0.0.0:2380"
- "--initial-cluster-token"
- "tkn"
- "--initial-cluster-state"
- "new"
entrypoint: "/usr/local/bin/etcd"
image: "gcr.io/etcd-development/etcd:v3.3.8"
ports:
- "2379:2379"
weaviate:
command:
- "--host"
- "0.0.0.0"
- "--port"
- "8080"
- "--scheme"
- "http"
- "--config-file"
- "config.yaml"
depends_on:
- "esvector"
image: "semitechnologies/weaviate:0.21.4"
ports:
- "8080:8080"
restart: "on-failure:0"
volumes:
- "./config.yaml:/config.yaml"
weaviate-playground:
depends_on:
- "weaviate"
image: "semitechnologies/weaviate-playground:latest"
ports:
- "80:80"
version: "3.4"

7 changes: 5 additions & 2 deletions entities/models/classification.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion entities/schema/accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (s *Schema) GetKindOfClass(className ClassName) (kind.Kind, bool) {
return "", false
}

// TODO: fix order of error and property
func (s *Schema) GetProperty(kind kind.Kind, className ClassName, propName PropertyName) (*models.Property, error) {
semSchemaClass, err := GetClassByName(s.SemanticSchemaFor(kind), string(className))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions openapi-specs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@
"type": {
"description": "which algorythim to use for classifications",
"type": "string",
"enum": ["knn"],
"enum": ["knn", "contextual"],
"default": "knn",
"example": "knn"
},
Expand Down Expand Up @@ -885,7 +885,7 @@
},
"description": "Open Source Knowledge Graph (GraphQL/RESTful/P2P)",
"title": "Weaviate",
"version": "0.21.3"
"version": "0.21.4"
},
"parameters": {
"CommonLimitParameterQuery": {
Expand Down
2 changes: 1 addition & 1 deletion usecases/classification/authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Test_Classifier_Authorization(t *testing.T) {
for _, test := range tests {
authorizer := &authDenier{}
repo := &fakeClassificationRepo{}
vectorRepo := &fakeVectorRepo{}
vectorRepo := &fakeVectorRepoKNN{}
schemaGetter := &fakeSchemaGetter{}

classifier := New(schemaGetter, repo, vectorRepo, authorizer)
Expand Down

0 comments on commit 1258419

Please sign in to comment.