Skip to content

Commit 2f7698c

Browse files
committed
RD-2603: Add embeddings mode options to semantic vectors and similar terms endpoints in the model
1 parent 54913ab commit 2f7698c

File tree

3 files changed

+54
-15
lines changed

3 files changed

+54
-15
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2023 Basis Technology Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.basistech.rosette.apimodel;
18+
19+
/**
20+
* The generation of embeddings to use for all languages. Defaults to second generation unless the language only
21+
* supports first generation embeddings
22+
*/
23+
public enum EmbeddingsMode {
24+
DEFAULT,
25+
GEN_1,
26+
GEN_2,
27+
/**/;
28+
}
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
* Copyright 2018 Basis Technology Corp.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
2+
* Copyright 2023 Basis Technology Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616
package com.basistech.rosette.apimodel;
1717

1818
import com.basistech.rosette.annotations.JacksonMixin;
@@ -32,4 +32,9 @@ public class SemanticVectorsOptions extends Options {
3232
*/
3333
private Boolean perToken;
3434

35+
/**
36+
* @return the generation of embeddings to use for all languages, defaulting to second generation embeddings unless
37+
* the language supports first generation embeddings
38+
*/
39+
private EmbeddingsMode embeddingsMode;
3540
}

model/src/main/java/com/basistech/rosette/apimodel/SimilarTermsOptions.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Basis Technology Corp.
2+
* Copyright 2023 Basis Technology Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,4 +42,10 @@ public class SimilarTermsOptions extends Options {
4242
* @return the number of similar terms requested
4343
*/
4444
private final Integer count;
45+
46+
/**
47+
* @return the generation of embeddings to use for all languages, defaulting to second generation embeddings unless
48+
* the language supports first generation embeddings
49+
*/
50+
private EmbeddingsMode embeddingsMode;
4551
}

0 commit comments

Comments
 (0)