Trent commited on
Commit
3a9a750
·
2 Parent(s): 75efc41 7b04075

Merge branch 'main' of https://huggingface.co/spaces/flax-sentence-embeddings/sentence-embeddings into main

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -16,17 +16,19 @@ st.markdown('''
16
 
17
  Hi! This is the demo for the [flax sentence embeddings](https://huggingface.co/flax-sentence-embeddings) created for the **Flax/JAX community week 🤗**.
18
  We trained three general-purpose flax-sentence-embeddings models: a **distilroberta base**, a **mpnet base** and a **minilm-l6**.
19
- All were trained on all the dataset of the 1B+ train corpus with the v3 setup.
20
 
21
- In addition, we trained 20 models focused on general-purpose, QuestionAnswering and Codesearch.
22
- View our models here : https://huggingface.co/flax-sentence-embeddings
 
 
23
 
24
  ''')
25
 
26
  if menu == "Sentence Similarity":
27
  st.header('Sentence Similarity')
28
  st.markdown('''
29
- **Instructions**: You can compare the similarity of a main text with other texts of your choice. In the background, we'll create an embedding for each text, and then we'll use the cosine similarity function to calculate a similarity metric between our main sentence and the others.
30
 
31
  For more cool information on sentence embeddings, see the [sBert project](https://www.sbert.net/examples/applications/computing-embeddings/README.html).
32
  ''')
@@ -64,8 +66,8 @@ For more cool information on sentence embeddings, see the [sBert project](https:
64
  elif menu == "Asymmetric QA":
65
  st.header('Asymmetric QA')
66
  st.markdown('''
67
- **Instructions**: You can compare the Answer likeliness of a given Query with answer candidates of your choice. In the background, we'll create an embedding for each answers, and then we'll use the cosine similarity function to calculate a similarity metric between our query sentence and the others.
68
- `mpnet_asymmetric_qa` model works best for hard negative answers or distinguishing similar queries due to separate models applied for encoding questions and answers.
69
 
70
  For more cool information on sentence embeddings, see the [sBert project](https://www.sbert.net/examples/applications/computing-embeddings/README.html).
71
  ''')
@@ -79,7 +81,7 @@ For more cool information on sentence embeddings, see the [sBert project](https:
79
 
80
  n_texts = st.number_input(
81
  f'''How many answers you want to compare with: '{anchor}'?''',
82
- value=10,
83
  min_value=2)
84
 
85
  inputs = []
 
16
 
17
  Hi! This is the demo for the [flax sentence embeddings](https://huggingface.co/flax-sentence-embeddings) created for the **Flax/JAX community week 🤗**.
18
  We trained three general-purpose flax-sentence-embeddings models: a **distilroberta base**, a **mpnet base** and a **minilm-l6**.
19
+ The models were trained on a dataset comprising of [1 Billion+ training corpus](https://huggingface.co/flax-sentence-embeddings/all_datasets_v4_MiniLM-L6#training-data) with the v3 setup.
20
 
21
+ In addition, we trained [20 models](https://huggingface.co/flax-sentence-embeddings) focused on general-purpose, QuestionAnswering and Code search.
22
+ You can view our models [here](https://huggingface.co/flax-sentence-embeddings)
23
+
24
+ To evaluate the [flax-sentence-embeddings](https://huggingface.co/flax-sentence-embeddings) *Sentence Similarity models* for *Gender Bias based on stereotypical occupations*, we created an *evaluation set* which can be found [here](https://huggingface.co/datasets/manandey/Gender_Bias_Evaluation)
25
 
26
  ''')
27
 
28
  if menu == "Sentence Similarity":
29
  st.header('Sentence Similarity')
30
  st.markdown('''
31
+ **Instructions**: You can compare the similarity of the main text with other texts of your choice. In the background, we'll create an embedding for each text, and then we'll use the cosine similarity function to calculate a similarity metric between our main sentence and the others.
32
 
33
  For more cool information on sentence embeddings, see the [sBert project](https://www.sbert.net/examples/applications/computing-embeddings/README.html).
34
  ''')
 
66
  elif menu == "Asymmetric QA":
67
  st.header('Asymmetric QA')
68
  st.markdown('''
69
+ **Instructions**: You can compare the Answer likeliness of a given Query with answer candidates of your choice. In the background, we'll create an embedding for each answer, and then we'll use the cosine similarity function to calculate a similarity metric between our query sentence and the others.
70
+ `mpnet_asymmetric_qa` model works best for hard-negative answers or distinguishing similar queries due to separate models applied for encoding questions and answers.
71
 
72
  For more cool information on sentence embeddings, see the [sBert project](https://www.sbert.net/examples/applications/computing-embeddings/README.html).
73
  ''')
 
81
 
82
  n_texts = st.number_input(
83
  f'''How many answers you want to compare with: '{anchor}'?''',
84
+ value=3,
85
  min_value=2)
86
 
87
  inputs = []