+
${this.renderSalienceControls()}
+
${this.renderFacetControls()}
+
+ ${Object.entries(this.summaries)
+ .sort()
+ .map(([facet, summary]) => {
+ const toggle = () => {
+ this.expanded[facet] = !this.expanded[facet];
+ };
+ return html`
+
+
+ ${this.expanded[facet] ? this.renderTable(summary) : ''}
+
`;
+ })}
+
+
`;
+ // clang-format on
+ }
+}
+
+declare global {
+ interface HTMLElementTagNameMap {
+ 'feature-attribution-module': FeatureAttributionModule;
+ }
+}
diff --git a/lit_nlp/client/modules/salience_map_module.ts b/lit_nlp/client/modules/salience_map_module.ts
index 86996753..8f0d2ddb 100644
--- a/lit_nlp/client/modules/salience_map_module.ts
+++ b/lit_nlp/client/modules/salience_map_module.ts
@@ -59,11 +59,14 @@ interface FeatureSalienceResult {
[key: string]: {salience: FeatureSalienceMap};
}
+type SalienceResult = TokenSalienceResult | ImageSalienceResult |
+ FeatureSalienceResult;
+
/**
* UI status for each interpreter.
*/
interface InterpreterState {
- salience: TokenSalienceResult|ImageSalienceResult|FeatureSalienceResult;
+ salience: SalienceResult;
autorun: boolean;
isLoading: boolean;
cmap: SalienceCmap;
@@ -280,8 +283,7 @@ export class SalienceMapModule extends LitModule {