Commit
•
2fee2c6
1
Parent(s):
3180c78
Delete models/retriever/level-4-small-no-negative-interventions
Browse files- models/retriever/level-4-small-no-negative-interventions/document_index/config.yaml +0 -5
- models/retriever/level-4-small-no-negative-interventions/document_index/documents.jsonl +0 -0
- models/retriever/level-4-small-no-negative-interventions/document_index/embeddings.pt +0 -3
- models/retriever/level-4-small-no-negative-interventions/document_index_db/config.yaml +0 -5
- models/retriever/level-4-small-no-negative-interventions/document_index_db/documents.jsonl +0 -35
- models/retriever/level-4-small-no-negative-interventions/document_index_db/embeddings.pt +0 -3
- models/retriever/level-4-small-no-negative-interventions/question_encoder/config.json +0 -29
- models/retriever/level-4-small-no-negative-interventions/question_encoder/hf.py +0 -99
- models/retriever/level-4-small-no-negative-interventions/question_encoder/pytorch_model.bin +0 -3
- models/retriever/level-4-small-no-negative-interventions/question_encoder/special_tokens_map.json +0 -7
- models/retriever/level-4-small-no-negative-interventions/question_encoder/tokenizer.json +0 -0
- models/retriever/level-4-small-no-negative-interventions/question_encoder/tokenizer_config.json +0 -13
- models/retriever/level-4-small-no-negative-interventions/question_encoder/vocab.txt +0 -0
models/retriever/level-4-small-no-negative-interventions/document_index/config.yaml
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
_target_: relik.retriever.indexers.inmemory.InMemoryDocumentIndex
|
2 |
-
metadata_fields:
|
3 |
-
- definition
|
4 |
-
separator: ' <def> '
|
5 |
-
name_or_path: null
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/document_index/documents.jsonl
DELETED
The diff for this file is too large to render.
See raw diff
|
|
models/retriever/level-4-small-no-negative-interventions/document_index/embeddings.pt
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:32ca332d324e25861dbb0ec02a64e7b3f753ee725a76df7ac7a7f9b8b54c2bfc
|
3 |
-
size 928171
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/document_index_db/config.yaml
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
_target_: relik.retriever.indexers.inmemory.InMemoryDocumentIndex
|
2 |
-
metadata_fields:
|
3 |
-
- definition
|
4 |
-
separator: ' <def> '
|
5 |
-
name_or_path: null
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/document_index_db/documents.jsonl
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
{"text": "flocculation/disinfection", "id": 0, "metadata": {"definition": "intervention. these interventions provide, or promote the uptake of, flocculation/disinfection for use at home. these combined coagulant-chlorine disinfection systems are commercial kits that combine dry coagulant/flocculent and chlorine as tablets or sachets.", "level": 4, "type": "intervention"}}
|
2 |
-
{"text": "entrepreneurship training", "id": 1, "metadata": {"definition": "intervention. provision of entrepreneurship training focused on how to start up a business from scratch, which can include for example developing a business plan, day-to-day management of small enterprise, including bookkeeping, financial planning, etc.", "level": 4, "type": "intervention"}}
|
3 |
-
{"text": "general health counselling", "id": 2, "metadata": {"definition": "intervention. group or individual counselling to promote best practices and transmit knowledge.", "level": 4, "type": "intervention"}}
|
4 |
-
{"text": "technical and vocational education and training (tvet)", "id": 3, "metadata": {"definition": "intervention. education and training which provides knowledge and skills for employment. tvet uses formal, non-formal, and informal learning.", "level": 4, "type": "intervention"}}
|
5 |
-
{"text": "citizen feedback mechanisms", "id": 4, "metadata": {"definition": "intervention. interventions facilitating meetings between service users and providers, setting up grievance redress mechanisms and scorecards allowing users to rate providers.", "level": 4, "type": "intervention"}}
|
6 |
-
{"text": "subsidy for latrine", "id": 5, "metadata": {"definition": "intervention. these are interventions where a subsidy has been provided on cost of the materials to construct a latrine.", "level": 4, "type": "intervention"}}
|
7 |
-
{"text": "secondary water treatments", "id": 6, "metadata": {"definition": "intervention. interventions that provide, or promote the uptake of, secondary forms of water treatment or supply.", "level": 4, "type": "intervention"}}
|
8 |
-
{"text": "behavioural sanitation promotion", "id": 7, "metadata": {"definition": "intervention. these are interventions that encourage the practice of proper sanitation practices at the household or community level through behavioural promotion, such as using social pressure, environmental cues, nudges, or triggers of disgust and shame.", "level": 4, "type": "intervention"}}
|
9 |
-
{"text": "agricultural marketing training", "id": 8, "metadata": {"definition": "intervention. training in how to bring products to market, including price-setting and negotiation", "level": 4, "type": "intervention"}}
|
10 |
-
{"text": "representation of women & minorities", "id": 9, "metadata": {"definition": "intervention. introduction of quotas, reserved seats or similar within political institutions - such as parliament, state legislatures, and village councils - for women, ethnic minorities, and castes.", "level": 4, "type": "intervention"}}
|
11 |
-
{"text": "providing care to groups versus individual patients", "id": 10, "metadata": {"definition": "intervention. comparisons of providing care to groups versus individual patients, for example intensive group therapy, group vs individual antenatal care.", "level": 4, "type": "intervention"}}
|
12 |
-
{"text": "other life skills", "id": 11, "metadata": {"definition": "intervention. programmes that train and enhance other life skills.", "level": 4, "type": "intervention"}}
|
13 |
-
{"text": "peer support groups for menstrual hygiene and sensitisation", "id": 12, "metadata": {"definition": "intervention. interventions that encourage the formation of peer support groups for menstrual hygiene and sensitisation.", "level": 4, "type": "intervention"}}
|
14 |
-
{"text": "voucher for work", "id": 13, "metadata": {"definition": "intervention. voucher transfers to poor families and individuals in return from the provision of labour.", "level": 4, "type": "intervention"}}
|
15 |
-
{"text": "rotating/accumulated savings and credit associations", "id": 14, "metadata": {"definition": "intervention. a group of individuals acting as an informal financial institution in the form of an alternative financial vehicle. a rosca happens via set contributions and withdrawals to and from a common fund. an ascra happens via set contributions with the common fund used for extending credit within or outside of the group. these include savings and internal lending communities (silcs) and self-help groups (shg).", "level": 4, "type": "intervention"}}
|
16 |
-
{"text": "skills for conflict management", "id": 15, "metadata": {"definition": "intervention. interventions that aim at preventing disputes of scaling up at the community or village-level. this can include interventions promoting dialogue and negotiation skills or training on dispute resolution mechanisms to avoid the use of violence.", "level": 4, "type": "intervention"}}
|
17 |
-
{"text": "access and participation", "id": 16, "metadata": {"definition": "intervention. provision of support and services to increase access to services and participation (for example in education, employment, public life). this can be done for example through quotas in universities, public services and political institutions (affirmative positive actions) or through educational campaign and targeted encouragement (positive action) or other social inclusion interventions. for communication or behavioural change interventions relating to gender issues, please use the gender equality code.", "level": 4, "type": "intervention"}}
|
18 |
-
{"text": "counselling for job seekers", "id": 17, "metadata": {"definition": "intervention. counselling session with unemployed or youth job seekers to assist them in searching jobs, provide placement assistance, and advise them on skill development relevant to the job market. these include job fairs.", "level": 4, "type": "intervention"}}
|
19 |
-
{"text": "total sanitation campaign", "id": 18, "metadata": {"definition": "intervention. this is a specific intervention designed by the indian government. it involves an education component to drive-up the demand for sanitation services, and then in some areas also a subsidy for those below the poverty line.", "level": 4, "type": "intervention"}}
|
20 |
-
{"text": "peer-to-peer learning", "id": 19, "metadata": {"definition": "intervention. schemes to allow students to learn together, and from each other, such as study groups.", "level": 4, "type": "intervention"}}
|
21 |
-
{"text": "community latrine and toilet provision", "id": 20, "metadata": {"definition": "intervention. these interventions provide new or improved hardware for latrines, or other means of excreta disposal, for the community. a shared facility provided for a defined group of residents or an entire settlement / community. it is normally located in or near the community area and used by almost community members.", "level": 4, "type": "intervention"}}
|
22 |
-
{"text": "job placement schemes", "id": 21, "metadata": {"definition": "intervention. work placement programmes that seek to put job-seekers into positions within business or trade. these include internship or apprenticeship programmes.", "level": 4, "type": "intervention"}}
|
23 |
-
{"text": "behavioural hand hygiene promotion", "id": 22, "metadata": {"definition": "intervention. these are interventions that encourage the practice of proper handwashing at the household or community level through behavioural promotion, such as using social pressure, environmental cues, nudges, or triggers of disgust and shame.", "level": 4, "type": "intervention"}}
|
24 |
-
{"text": "peace education", "id": 23, "metadata": {"definition": "intervention. peace education interventions promote the knowledge, skills and attitudes that shape the social environment to both prevent conflict from occurring and help people to resolve it peacefully. these interventions can be run at many scales (i.e. local versus national) and often involve promoting a community dialogue. they usually cover a range of topics including non-violent conflict resolution techniques, human rights, democracy, disarmament, gender equality, tolerance and communication skills.", "level": 4, "type": "intervention"}}
|
25 |
-
{"text": "handwashing stations", "id": 24, "metadata": {"definition": "intervention. provision or improving of handwashing stations.", "level": 4, "type": "intervention"}}
|
26 |
-
{"text": "educational sanitation promotion", "id": 25, "metadata": {"definition": "intervention. these are interventions that encourage the practice of proper sanitation practices at the household or community level through educational promotion, such as sanitation management education, teaching best practices, and information on sanitation and waste management.", "level": 4, "type": "intervention"}}
|
27 |
-
{"text": "educational hand hygiene promotion", "id": 26, "metadata": {"definition": "intervention. these are interventions that encourage the practice of proper handwashing at the household or community level through educational promotion, such as hygiene education, teaching best practices, and information on hand hygiene.", "level": 4, "type": "intervention"}}
|
28 |
-
{"text": "community-led total sanitation (clts)", "id": 27, "metadata": {"definition": "intervention. clts is a participatory mechanism that mobilises communities by facilitating their own appraisal of, and action plan to address, open defecation. it often includes walks of shame, and the use of social pressures to elicit behaviour change.", "level": 4, "type": "intervention"}}
|
29 |
-
{"text": "financial literacy", "id": 28, "metadata": {"definition": "intervention. skills development in financial topics and products.", "level": 4, "type": "intervention"}}
|
30 |
-
{"text": "sexual and gender-based violence (sgbv) - prevention", "id": 29, "metadata": {"definition": "intervention. this group of interventions aim to prevent sexual and gender-based violence (sgbv) through a combination of methods such as media campaigns, behaviour-change communication, and education. this also includes the establishment of legal protections, such as new laws to criminalise sgbv, training for the police and courts on how to investigate and handle sgbv.", "level": 4, "type": "intervention"}}
|
31 |
-
{"text": "general maintenance of latrines", "id": 30, "metadata": {"definition": "intervention. maintaining cleanliness and ensuring good level of hygiene for facilities", "level": 4, "type": "intervention"}}
|
32 |
-
{"text": "labelled cash transfers", "id": 31, "metadata": {"definition": "intervention. monetary transfer to families or individuals without any formal conditionality attached to it, but labelled with the intended purpose of the transfer( soft conditionality). the aim of the transfer is emphasized when given to the beneficiaries but no monitoring of the beneficiaries' actions following the transfer is conducted.", "level": 4, "type": "intervention"}}
|
33 |
-
{"text": "health facility latrine and toilet provision", "id": 32, "metadata": {"definition": "intervention. these interventions provide new or improved hardware for latrines, or other means of excreta disposal, at a health facility.", "level": 4, "type": "intervention"}}
|
34 |
-
{"text": "transparency and accountability initiatives", "id": 33, "metadata": {"definition": "intervention. promotion of transparency and accountability through citizens' participation and monitoring initiatives.", "level": 4, "type": "intervention"}}
|
35 |
-
{"text": "care environment", "id": 34, "metadata": {"definition": "intervention. changes to the physical or sensory healthcare environment, by adding or altering equipment or layout, providing music, art.", "level": 4, "type": "intervention"}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/document_index_db/embeddings.pt
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:85c95ebf2afa90285e646888ab84dd1aefb047638b2900771983f51f83ac90a3
|
3 |
-
size 54955
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/config.json
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "intfloat/e5-small-v2",
|
3 |
-
"architectures": [
|
4 |
-
"GoldenRetrieverModel"
|
5 |
-
],
|
6 |
-
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"auto_map": {
|
8 |
-
"AutoModel": "hf.GoldenRetrieverModel"
|
9 |
-
},
|
10 |
-
"classifier_dropout": null,
|
11 |
-
"hidden_act": "gelu",
|
12 |
-
"hidden_dropout_prob": 0.1,
|
13 |
-
"hidden_size": 384,
|
14 |
-
"initializer_range": 0.02,
|
15 |
-
"intermediate_size": 1536,
|
16 |
-
"layer_norm_eps": 1e-12,
|
17 |
-
"max_position_embeddings": 512,
|
18 |
-
"model_type": "bert",
|
19 |
-
"num_attention_heads": 12,
|
20 |
-
"num_hidden_layers": 12,
|
21 |
-
"pad_token_id": 0,
|
22 |
-
"position_embedding_type": "absolute",
|
23 |
-
"projection_dim": null,
|
24 |
-
"torch_dtype": "float32",
|
25 |
-
"transformers_version": "4.33.3",
|
26 |
-
"type_vocab_size": 2,
|
27 |
-
"use_cache": true,
|
28 |
-
"vocab_size": 30522
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/hf.py
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
from typing import Tuple, Union
|
2 |
-
|
3 |
-
import torch
|
4 |
-
from transformers import PretrainedConfig
|
5 |
-
from transformers.modeling_outputs import BaseModelOutputWithPoolingAndCrossAttentions
|
6 |
-
from transformers.models.bert.modeling_bert import BertModel
|
7 |
-
|
8 |
-
|
9 |
-
class GoldenRetrieverConfig(PretrainedConfig):
|
10 |
-
model_type = "bert"
|
11 |
-
|
12 |
-
def __init__(
|
13 |
-
self,
|
14 |
-
vocab_size=30522,
|
15 |
-
hidden_size=768,
|
16 |
-
num_hidden_layers=12,
|
17 |
-
num_attention_heads=12,
|
18 |
-
intermediate_size=3072,
|
19 |
-
hidden_act="gelu",
|
20 |
-
hidden_dropout_prob=0.1,
|
21 |
-
attention_probs_dropout_prob=0.1,
|
22 |
-
max_position_embeddings=512,
|
23 |
-
type_vocab_size=2,
|
24 |
-
initializer_range=0.02,
|
25 |
-
layer_norm_eps=1e-12,
|
26 |
-
pad_token_id=0,
|
27 |
-
position_embedding_type="absolute",
|
28 |
-
use_cache=True,
|
29 |
-
classifier_dropout=None,
|
30 |
-
projection_dim=None,
|
31 |
-
**kwargs,
|
32 |
-
):
|
33 |
-
super().__init__(pad_token_id=pad_token_id, **kwargs)
|
34 |
-
|
35 |
-
self.vocab_size = vocab_size
|
36 |
-
self.hidden_size = hidden_size
|
37 |
-
self.num_hidden_layers = num_hidden_layers
|
38 |
-
self.num_attention_heads = num_attention_heads
|
39 |
-
self.hidden_act = hidden_act
|
40 |
-
self.intermediate_size = intermediate_size
|
41 |
-
self.hidden_dropout_prob = hidden_dropout_prob
|
42 |
-
self.attention_probs_dropout_prob = attention_probs_dropout_prob
|
43 |
-
self.max_position_embeddings = max_position_embeddings
|
44 |
-
self.type_vocab_size = type_vocab_size
|
45 |
-
self.initializer_range = initializer_range
|
46 |
-
self.layer_norm_eps = layer_norm_eps
|
47 |
-
self.position_embedding_type = position_embedding_type
|
48 |
-
self.use_cache = use_cache
|
49 |
-
self.classifier_dropout = classifier_dropout
|
50 |
-
self.projection_dim = projection_dim
|
51 |
-
|
52 |
-
|
53 |
-
class GoldenRetrieverModel(BertModel):
|
54 |
-
config_class = GoldenRetrieverConfig
|
55 |
-
|
56 |
-
def __init__(self, config, *args, **kwargs):
|
57 |
-
super().__init__(config)
|
58 |
-
self.layer_norm_layer = torch.nn.LayerNorm(
|
59 |
-
config.hidden_size, eps=config.layer_norm_eps
|
60 |
-
)
|
61 |
-
self.projection: torch.nn.Module | None = None
|
62 |
-
if config.projection_dim is not None:
|
63 |
-
self.projection = torch.nn.Sequential(
|
64 |
-
torch.nn.Linear(config.hidden_size, config.projection_dim),
|
65 |
-
torch.nn.LayerNorm(config.projection_dim),
|
66 |
-
)
|
67 |
-
|
68 |
-
def forward(
|
69 |
-
self, **kwargs
|
70 |
-
) -> Union[Tuple[torch.Tensor], BaseModelOutputWithPoolingAndCrossAttentions]:
|
71 |
-
attention_mask = kwargs.get("attention_mask", None)
|
72 |
-
model_outputs = super().forward(**kwargs)
|
73 |
-
if attention_mask is None:
|
74 |
-
pooler_output = model_outputs.pooler_output
|
75 |
-
else:
|
76 |
-
token_embeddings = model_outputs.last_hidden_state
|
77 |
-
input_mask_expanded = (
|
78 |
-
attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
79 |
-
)
|
80 |
-
pooler_output = torch.sum(
|
81 |
-
token_embeddings * input_mask_expanded, 1
|
82 |
-
) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
|
83 |
-
|
84 |
-
pooler_output = self.layer_norm_layer(pooler_output)
|
85 |
-
|
86 |
-
if self.projection is not None:
|
87 |
-
pooler_output = self.projection(pooler_output)
|
88 |
-
|
89 |
-
if not kwargs.get("return_dict", True):
|
90 |
-
return (model_outputs[0], pooler_output) + model_outputs[2:]
|
91 |
-
|
92 |
-
return BaseModelOutputWithPoolingAndCrossAttentions(
|
93 |
-
last_hidden_state=model_outputs.last_hidden_state,
|
94 |
-
pooler_output=pooler_output,
|
95 |
-
past_key_values=model_outputs.past_key_values,
|
96 |
-
hidden_states=model_outputs.hidden_states,
|
97 |
-
attentions=model_outputs.attentions,
|
98 |
-
cross_attentions=model_outputs.cross_attentions,
|
99 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f0d87cf1f25fa91a62abdeb2bb88332989c2467bb8231a0807b2b7482c44afcc
|
3 |
-
size 133510894
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/special_tokens_map.json
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cls_token": "[CLS]",
|
3 |
-
"mask_token": "[MASK]",
|
4 |
-
"pad_token": "[PAD]",
|
5 |
-
"sep_token": "[SEP]",
|
6 |
-
"unk_token": "[UNK]"
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/tokenizer.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/tokenizer_config.json
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"clean_up_tokenization_spaces": true,
|
3 |
-
"cls_token": "[CLS]",
|
4 |
-
"do_lower_case": true,
|
5 |
-
"mask_token": "[MASK]",
|
6 |
-
"model_max_length": 512,
|
7 |
-
"pad_token": "[PAD]",
|
8 |
-
"sep_token": "[SEP]",
|
9 |
-
"strip_accents": null,
|
10 |
-
"tokenize_chinese_chars": true,
|
11 |
-
"tokenizer_class": "BertTokenizer",
|
12 |
-
"unk_token": "[UNK]"
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/retriever/level-4-small-no-negative-interventions/question_encoder/vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|