Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] - ModuleConfig #108

Open
morrowyn opened this issue May 29, 2022 · 1 comment
Open

[Question] - ModuleConfig #108

morrowyn opened this issue May 29, 2022 · 1 comment

Comments

@morrowyn
Copy link

morrowyn commented May 29, 2022

Hi,

I'm trying to port the python example to java. https://github.com/semi-technologies/weaviate-examples/blob/34bb73f8d2096e04aaf19455f2f8da743f21b8d5/attendance-system-example/student_add.py#L32

However I'm missing some documentation on how to create the following ModuleConfig.

"moduleConfig": {
            "img2vec-neural": {
                "imageFields": [
                    "image"
                ]
            }
        },

Any idea how I should go about this?

Regards,

p.s. I receive the following error:
module 'img2vec-neural': imageFields not present
after I have added the following code to the schema:

.vectorIndexType("hnsw")
.vectorizer("img2vec-neural")
@morrowyn
Copy link
Author

The following works. It would be nice if this was more type-safe and using the builder pattern.

var moduleConfigFields = new HashMap<String, String[]>();
moduleConfigFields.put("imageFields", new String[]{ "your-image-field" });

var moduleConfig = new HashMap<String, Object>();
moduleConfig.put("img2vec-neural", moduleConfigFields);

var schemaClass = WeaviateClass.builder()
.ModuleConfig(moduleConfig)
// your schema 
.build()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant