Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-Attention Mechanism is Incredibly Inaccurate #8

Open
DragonflyRobotics opened this issue Jun 20, 2022 · 0 comments
Open

Self-Attention Mechanism is Incredibly Inaccurate #8

DragonflyRobotics opened this issue Jun 20, 2022 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@DragonflyRobotics
Copy link
Member

Description
As of now, the Self-Attention Mechanism is using a simple Cosine Similarity/Dot Product Similarity Algorithm with a selectivity threshold. This is proven to be very inaccurate and cannot be reverse searched as the incorrect selections will invalidate the integrity of the database.

To Reproduce
To reproduce the behavior:

from MAGIST.NLP.SelfAttention import TextPreprocessing

t = TextPreprocessing("config.json")

out = t.__call__("Hello, my name is John. I am a dummy script.")

for i in out:
    print(i)

Output

[5.967583262815608, 'hello', 'Good']
[3.7432159225461947, 'my', 'Not']
[2.520566459677965, 'name', 'Not']           ---> Incorrect; This should be "Good"
[5.6983463875519735, 'is', 'Not']
[4.848795399908668, 'john', 'Not']
[6.083478457022617, 'i', 'Good']
[9.443521265161667, 'am', 'Good']
[8.284217064260607, 'a', 'Good']             ---> Incorrect; This should be "Not"
[8.485852410408823, 'dummy', 'Good']
[2.466104715281189, 'script', 'Not']         ---> Incorrect; This should be "Good"

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
This was expected since this algorithm is very primitive. Perhaps, a better positional embedding or an end-to-end LSTM-Dense neural network would improve its performance.

@DragonflyRobotics DragonflyRobotics added bug Something isn't working enhancement New feature or request labels Jun 20, 2022
@DragonflyRobotics DragonflyRobotics self-assigned this Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

1 participant