-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32f5823
commit 240074d
Showing
30 changed files
with
1,638 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ty-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/model/QuerySetQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -e | ||
|
||
curl -X GET http://localhost:9200/ubi_events/_search -H "Content-Type: application/json" -d' | ||
{ | ||
"size": 0, | ||
"aggs": { | ||
"By_Action": { | ||
"terms": { | ||
"field": "action_name" | ||
}, | ||
"aggs": { | ||
"By_Position": { | ||
"terms": { | ||
"field": "event_attributes.position.index" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}' | jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'java-library-distribution' | ||
apply plugin: 'application' | ||
|
||
description = "opensearch-search-quality-implicit-judgments" | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.opensearch.client:opensearch-rest-high-level-client:2.18.0' | ||
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4' | ||
compileOnly "org.apache.logging.log4j:log4j-core:2.24.0" | ||
implementation "org.apache.commons:commons-lang3:3.17.0" | ||
implementation "com.google.code.gson:gson:2.11.0" | ||
|
||
testImplementation "org.mockito:mockito-core:5.14.2" | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3' | ||
} | ||
|
||
tasks.withType(Tar){ | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} | ||
|
||
tasks.withType(Zip){ | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
GET ubi_queries/_search | ||
|
||
GET ubi_events/_search | ||
|
||
GET rank_aggregated_ctr/_search | ||
|
||
GET click_through_rates/_search | ||
|
||
GET judgments/_search | ||
|
||
DELETE rank_aggregated_ctr,click_through_rates,judgments |
35 changes: 35 additions & 0 deletions
35
opensearch-search-quality-evaluation/src/main/java/org/opensearch/eval/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.opensearch.eval; | ||
|
||
import org.apache.http.HttpHost; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.opensearch.client.RestClient; | ||
import org.opensearch.client.RestClientBuilder; | ||
import org.opensearch.client.RestHighLevelClient; | ||
import org.opensearch.eval.clickmodel.coec.CoecClickModel; | ||
import org.opensearch.eval.clickmodel.coec.CoecClickModelParameters; | ||
import org.opensearch.eval.model.Judgment; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Entry point for the OpenSearch Evaluation Framework standalone app. | ||
*/ | ||
public class App { | ||
|
||
private static final Logger LOGGER = LogManager.getLogger(App.class.getName()); | ||
|
||
public static void main(String[] args) throws Exception { | ||
|
||
final RestClientBuilder builder = RestClient.builder(new HttpHost("localhost", 9200, "http")); | ||
final RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder); | ||
|
||
final CoecClickModelParameters coecClickModelParameters = new CoecClickModelParameters(false, 20); | ||
final CoecClickModel coecClickModel = new CoecClickModel(coecClickModelParameters); | ||
|
||
final Collection<Judgment> judgments = coecClickModel.calculateJudgments(); | ||
Judgment.showJudgments(judgments); | ||
|
||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...ch-search-quality-evaluation/src/main/java/org/opensearch/eval/clickmodel/ClickModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.opensearch.eval.clickmodel; | ||
|
||
import org.opensearch.eval.model.Judgment; | ||
|
||
import java.io.IOException; | ||
import java.util.Collection; | ||
|
||
public abstract class ClickModel<T extends ClickModelParameters> { | ||
|
||
public static final String INDEX_UBI_EVENTS = "ubi_events"; | ||
public static final String INDEX_UBI_QUERIES = "ubi_queries"; | ||
|
||
public abstract Collection<Judgment> calculateJudgments() throws IOException; | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...quality-evaluation/src/main/java/org/opensearch/eval/clickmodel/ClickModelParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.opensearch.eval.clickmodel; | ||
|
||
public abstract class ClickModelParameters { | ||
|
||
} |
Oops, something went wrong.