K
K
kuzdman2018-06-04 08:17:13
Python
kuzdman, 2018-06-04 08:17:13

How to normalize a large vector (300 dimensional) into a single one in python?

Hello! I have a 300-dimensional vector for a word . I need to convert it to a single .
Here is an example of a large vector.

кинопремия -0.39599 0.15361 -0.054353 -0.084541 -0.21195 -0.14466 0.043849 -0.17055 0.11399 -0.054723 0.4124 0.18527 0.010218 0.14591 -0.43762 0.14834 -0.33062 0.18308 0.33567 0.3302 0.22114 0.27989 -0.12369 0.19794 -0.017693 -0.73528 0.22559 -0.26763 0.060893 0.3247 -0.30745 0.22487 0.073927 -0.053017 -0.1336 0.048284 -0.71521 -0.83566 -0.26763 -0.27965 -0.10643 -0.58461 0.38492 0.3559 -0.53408 -0.37868 -0.73561 -0.2911 0.23721 -0.41514 0.054392 -0.25579 0.73031 -0.031331 -0.02327 0.68159 -0.26245 0.77822 0.17122 -0.0073271 0.53919 0.47069 -0.26361 0.38773 0.59006 0.49435 0.37452 -0.11856 0.48939 -0.74596 0.028492 -0.42083 0.22867 -0.32096 0.15396 0.48965 -0.22346 0.34322 0.18342 -0.20913 -0.5091 -0.31168 0.55683 -0.22638 0.94871 0.39884 0.28908 0.021856 0.29571 -0.62925 0.10685 0.26937 0.39608 -0.15843 0.3476 0.26686 -0.037044 0.46999 -0.2708 -0.31867 -0.1785 -0.22738 -0.088346 -0.69456 0.34816 0.72422 -0.63726 -0.10827 0.31053 0.49944 0.58209 0.83259 0.25572 -0.063025 -1.0251 -0.28817 0.13773 0.611 -0.45255 -0.082971 0.47933 0.33863 0.28145 -0.15813 1.2022 -0.10342 -0.24083 0.46153 -0.13299 0.53631 0.16939 0.76783 0.3057 -0.12956 0.10469 0.80905 -0.3888 -0.73049 0.14586 0.09412 -0.63672 -0.56385 -0.12519 -0.22866 -0.043856 -0.49567 -0.16697 0.027054 -0.57656 -0.26014 0.36477 -0.5623 -0.22665 -0.26589 -0.14938 -0.11643 -0.2441 0.088156 0.53896 -0.23627 -0.2355 -0.11332 0.39915 -0.14017 -0.54467 -0.17506 -0.41576 -1.0129 0.0035489 -0.29644 -0.49275 0.074459 -0.072859 0.48817 0.17414 0.3551 -0.74098 -0.23549 -0.28171 -0.32766 0.06 -0.26279 -0.072592 -0.23371 0.3206 -0.32918 0.08394 0.42433 0.26058 -0.21498 0.061066 -1.1024 0.5618 -0.1909 -0.33444 -0.22458 -0.46453 -0.22444 -0.6917 0.11827 -0.11813 0.60918 -0.046795 0.20467 -0.33597 -0.20627 0.12081 0.20995 0.30934 0.22902 0.2321 -0.3889 0.17327 -0.15667 -0.55331 0.20027 0.12321 0.41373 0.41293 0.021831 0.066625 0.41137 -0.58894 -0.62863 -0.26073 0.44928 0.10493 -0.2486 -0.052871 -0.14125 0.28809 0.69296 -0.045789 -0.11126 0.18046 0.094964 -0.10468 -0.2301 0.15089 0.41678 -0.39491 0.46118 0.54207 0.14869 0.77228 0.3162 0.37785 -0.020872 0.54205 -0.02357 -0.4083 -0.41413 -0.14484 -0.18124 -0.11155 0.19733 -0.24348 0.31579 -0.14241 -0.11472 -0.23788 0.024573 -0.11151 0.69825 -0.23812 0.069828 -0.040976 0.20537 0.35387 -0.39042 0.042156 0.12654 -0.032531 0.53471 -0.37994 0.17996 -0.29754 -0.35801 0.31234 0.058258 -0.014872 0.12273 -0.0086519 0.57335 -0.39897 0.55601 -0.32257 -0.017854 -0.087978 0.056316 0.11747 -0.78808 -0.46809 0.26497 0.71402 0.032325 0.30829 -0.14147 -0.21781 0.20456

Please tell me the formula or ready-made python code .
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
longclaps, 2018-06-04
@longclaps

tyts

G
Griboks, 2018-06-04
@Griboks

I will surprise you
a/|a|

V
Vladimir Olohtonov, 2018-06-04
@sgjurano

What you want to get is the value of some function from two vectors, not a unit vector.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question