semvec/pypi-packages huggingface dataset:
Topsis-Abhishek-102003439 0.1
Doing Evaluation of alternatives based on multiple criteria using TOPSIS method.

## Topsis:-MULTIPLE-CRITERIA DECISION MAKING

# TOPSIS

Submitted By: **SANJOLI AGARWAL 102003425**.

Date: **21-JAN-2023**.

Description: **Evaluation of alternatives based on multiple criteria using TOPSIS method.**.

---

## What is TOPSIS?

**T**echnique for **O**rder **P**reference by **S**imilarity to **I**deal **S**olution
TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution,
and greatest distance from the negative-ideal solution.

<br>

## How to install this package:

```
>>pip install Topsis_Sanjoli_102003425
```

### In Command Prompt

```
>> topsis data.csv "1,1,1,1" "+,+,-,+" result.csv
```

## Input file (data.csv)

The decision matrix should be constructed with each row representing a Model alternative, and each column representing a criterion like Attribute, Price or cost, Storage Space ,Camera,Looks.

| Attribute | Price or cost | Storage Space | Camera| Looks |
| -----     | -----------   | ------------- | ---- | -------|
| Mobile 1  | 250$          | 16GB          | 12MP | 5      |
| Mobile 2  | 200$          | 16GB          | 8MP  | 3      |
| Mobile 3  | 300$          | 32GB          | 16MP | 4      |
| Mobile 4  | 275$          | 32GB          | 8MP  | 4      |
| Mobile 5  | 225$          | 16GB          | 16MP | 2      |

Weights (`weights`) is not already normalised will be normalised later in the code.

Information of benefit positive(+) or negative(-) impact criteria should be provided in `impacts`.

<br>

## Output file (result.csv)

| Attribute | Price or cost | Storage Space | Camera| Looks | Topsis_score | Rank|
| -----     | -----------   | ------------- | ---- | -------| ------------ | ----|
| Mobile 1  |250$           | 16GB          | 12MP | 5      | 0.4228       | 4   |
| Mobile 2  |200$           | 16GB          | 8MP  | 3      | 0.4635       | 3   |
| Mobile 3  |300$           | 32GB          | 16MP | 4      | 0.5097       | 2   |
| Mobile 4  |275$           | 32GB          | 8MP  | 4      | 0.3772       | 5   |
| Mobile 5  |225$           | 16GB          | 16MP | 2      | 0.6871       | 1   |


<br>
The output file contains columns of input file along with two additional columns having **Topsis_score** and **Rank**
BertWordEmbeddingsFromContext 0.0.1
Extract bert word embedding from sentence (based on the context)
Keywords: python,nlp,bert,text,transformers,embedding,word embedding,sentence embedding,context embedding,word embedding from context,sentence embedding from context,context embedding from context,similarity

# bert-word-embeddings-from-context-sentence :shipit:

*One way to confirm contextually dependent vectors is by evaluating the model's performance on tasks that require understanding the meaning of words in context, such as natural language inference or question answering. Another way is to perform a qualitative analysis by comparing the embeddings generated for a specific word in different sentences or contexts, and observing if they are similar or dissimilar.*

```python
from word_embeddings_from_context import  get_word_embedding_from_sentence

text_1 = "bring some money"
text_2 = "bring your focus to your heart"

word = "bring"

embedding_1 = get_word_embedding_from_sentence(text_1,word)
embedding_2 = get_word_embedding_from_sentence(text_2,word)

print(embedding_1[0:5])
print(embedding_2[0:5])

```
> Output 1 : tensor([ 0.1592,  0.4534,  2.8211, -1.0691,  1.4695])

> Output 2 : tensor([ 2.2381,  0.2831,  1.0606, -2.3082, -0.1782])

As you can see, the same word has different embeddings depending on the context :+1:

### 📝 If a sentence contains more than one word, you get them all by setting `all_index=True` .

```python
text = "After stealing money from the bank vault, the bank robber was seen fishing on the Mississippi river bank."
word = "bank"

embedding = get_word_embedding_from_sentence(text,word,all_index=True)
print(embedding)
```
> Output : [embedding_1,embedding_2,embedding_3]