File size: 1,654 Bytes
09a837f
a69e0b2
09a837f
 
 
 
 
a69e0b2
09a837f
a69e0b2
 
 
 
09a837f
 
 
 
 
 
 
 
 
 
 
014f622
 
09a837f
12c646e
09a837f
014f622
 
 
 
09a837f
 
 
 
 
 
 
 
 
12c646e
 
a69e0b2
09a837f
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
title: Multilingual Dictionary Explorer
sdk: gradio
app_file: app.py
pinned: false
---

# Multilingual Dictionary Explorer

This Space is a Gradio UI for the same lookup logic as
`query_multilingual_space.py`: enter a source language and query word, then get
translations to all other languages using FAISS, CSLS, and optional
bidirectional consistency.

Required artifact files:

- `aligned_all.faiss`
- `all_metadata.jsonl`
- `config.json`

The app does not use `aligned_all.vec`.

## Runtime configuration

By default, the app scans the stage 6 prefix, downloads the newest artifact
folder that contains `config.json`, and selects it in the UI:

`s3://131-component-staging/multilingual-static-word-embeddings/stage-6/`

Older artifact folders found under the same prefix are available from the
Dictionary artifact dropdown. Switching artifacts reloads the aligned space and
updates the displayed load time.

Set these Hugging Face Space secrets for S3-compatible storage:

- `SE_ACCESS_KEY`
- `SE_SECRET_KEY`
- `SE_HOST_URL`

Optional environment overrides:

- `SPACE_ARTIFACT_S3_URI`: exact artifact folder, for example
  `s3://131-component-staging/multilingual-static-word-embeddings/stage-6/multilingual_dict_20260603_122323`
- `SPACE_ARTIFACT_S3_PREFIX`: prefix to scan for the newest `multilingual_dict_*` or `multilingual_space_*.json`
- `SPACE_DIR`: local artifact folder, useful for local testing
- `ARTIFACT_CACHE_DIR`: local cache directory, default `/tmp/multilingual_space_artifacts`

Defaults for `top_k`, `min_score`, `csls_k`, `candidate_retrieval_k`,
`csls_prefetch_k`, and bidirectional consistency are read from `config.json`.