Size: a a a

Machine learning

2021 June 17

В

Владимир in Machine learning
Всем привет!
Застрял на этом задании:
Создайте матрицу размера n * d, где n — число предложений. Заполните ее: элемент с индексом (i, j) в этой матрице должен быть равен количеству вхождений j-го слова в i-е предложение. У вас должна получиться матрица размера 22 * 254.
Подскажите в каком направлении идти?
источник

V

Valery in Machine learning
да кто ток там ни застревал...
источник

V

Valery in Machine learning
источник

В

Владимир in Machine learning
Я так понимаю проблемное место))
источник

V

Valery in Machine learning
да) поэтому не отчаивайся
источник

В

Владимир in Machine learning
Ахах, аж полегчало))
источник

Y

Yaroslav in Machine learning
С облегчением)
источник

А

Анастасия in Machine learning
ааххаха даа
источник

В

Владимир in Machine learning
Я вроде все шаги прошел, у меня сделано так же, не понимаю 7 шаг, что там делать надо?
источник

А

Анастасия in Machine learning
This is the way
источник

M

Maggie in Machine learning
Открой файл и посчитай количество предложений. Мне очень помогло)
источник

В

Владимир in Machine learning
file_obj = open('sentences.txt', 'r')
str = file_obj.readlines()
size = len(str)
print(size)
Я это сделал)
источник

В

Владимир in Machine learning
Так у меня получилось когда я проиндексировал каждое слово
{0: 'in', 1: 'comparison', 2: 'to', 3: 'dogs', 4: 'cats', 5: 'have', 6: 'not', 7: 'undergone', 8: 'major', 9: 'changes', 10: 'during', 11: 'the', 12: 'domestication', 13: 'process', 14: 'as', 15: 'cat', 16: 'simply', 17: 'catenates', 18: 'streams', 19: 'of', 20: 'bytes', 21: 'it', 22: 'can', 23: 'be', 24: 'also', 25: 'used', 26: 'to', 27: 'concatenate', 28: 'binary', 29: 'files', 30: 'where', 31: 'it', 32: 'will', 33: 'just', 34: 'concatenate', 35: 'sequence', 36: 'of', 37: 'bytes', 38: 'a', 39: 'common', 40: 'interactive', 41: 'use', 42: 'of', 43: 'cat', 44: 'for', 45: 'a', 46: 'single', 47: 'file', 48: 'is', 49: 'to', 50: 'output', 51: 'the', 52: 'content', 53: 'of', 54: 'a', 55: 'file', 56: 'to', 57: 'standard', 58: 'output', 59: 'cats', 60: 'can', 61: 'hear', 62: 'sounds', 63: 'too', 64: 'faint', 65: 'or', 66: 'too', 67: 'high', 68: 'in', 69: 'frequency', 70: 'for', 71: 'human', 72: 'ears', 73: 'such', 74: 'as', 75: 'those', 76: 'made', 77: 'by', 78: 'mice', 79: 'and', 80: 'other', 81: 'small', 82: 'animals', 83: 'in', 84: 'one', 85: 'people', 86: 'deliberately', 87: 'tamed', 88: 'cats', 89: 'in', 90: 'a', 91: 'process', 92: 'of', 93: 'artificial', 94: 'selection', 95: 'as', 96: 'they', 97: 'were', 98: 'useful', 99: 'predators', 100: 'of', 101: 'vermin', 102: 'the', 103: 'domesticated', 104: 'cat', 105: 'and', 106: 'its', 107: 'closest', 108: 'wild', 109: 'ancestor', 110: 'are', 111: 'both', 112: 'diploid', 113: 'organisms', 114: 'that', 115: 'possess', 116: 'chromosomes', 117: 'and', 118: 'roughly', 119: 'genes', 120: 'domestic', 121: 'cats', 122: 'are', 123: 'similar', 124: 'in', 125: 'size', 126: 'to', 127: 'the', 128: 'other', 129: 'members', 130: 'of', 131: 'the', 132: 'genus', 133: 'felis', 134: 'typically', 135: 'weighing', 136: 'between', 137: 'and', 138: 'kg', 139: 'and', 140: 'lb', 141: 'however', 142: 'if', 143: 'the', 144: 'output', 145: 'is', 146: 'piped', 147: 'or', 148: 'redirected', 149: 'cat', 150: 'is', 151: 'unnecessary', 152: 'cat', 153: 'with', 154: 'one', 155: 'named', 156: 'file', 157: 'is', 158: 'safer', 159: 'where', 160: 'human', 161: 'error', 162: 'is', 163: 'a', 164: 'concern', 165: 'one', 166: 'wrong', 167: 'use', 168: 'of', 169: 'the', 170: 'default', 171: 'redirection', 172: 'symbol', 173: 'instead', 174: 'of', 175: 'often', 176: 'adjacent', 177: 'on', 178: 'keyboards', 179: 'may', 180: 'permanently', 181: 'delete', 182: 'the', 183: 'file', 184: 'you', 185: 'were', 186: 'just', 187: 'needing', 188: 'to', 189: 'read', 190: 'in', 191: 'terms', 192: 'of', 193: 'legibility', 194: 'a', 195: 'sequence', 196: 'of', 197: 'commands', 198: 'starting', 199: 'with', 200: 'cat', 201: 'and', 202: 'connected', 203: 'by', 204: 'pipes', 205: 'has', 206: 'a', 207: 'clear', 208: 'left', 209: 'to', 210: 'right', 211: 'flow', 212: 'of', 213: 'information', 214: 'cat', 215: 'command', 216: 'is', 217: 'one', 218: 'of', 219: 'the', 220: 'basic', 221: 'commands', 222: 'that', 223: 'you', 224: 'learned', 225: 'when', 226: 'you', 227: 'started', 228: 'in', 229: 'the', 230: 'unix', 231: 'linux', 232: 'world', 233: 'using', 234: 'cat', 235: 'command', 236: 'the', 237: 'lines', 238: 'received', 239: 'from', 240: 'stdin', 241: 'can', 242: 'be', 243: 'redirected', 244: 'to', 245: 'a', 246: 'new', 247: 'file', 248: 'using', 249: 'redirection', 250: 'symbols', 251: 'when', 252: 'you', 253: 'type', 254: 'simply', 255: 'cat', 256: 'command', 257: 'without', 258: 'any', 259: 'arguments', 260: 'it', 261: 'just', 262: 'receives', 263: 'the', 264: 'stdin', 265: 'content', 266: 'and', 267: 'displays', 268: 'it', 269: 'in', 270: 'the', 271: 'stdout', 272: 'leopard', 273: 'was', 274: 'released', 275: 'on', 276: 'october', 277: 'as', 278: 'the', 279: 'successor', 280: 'of', 281: 'tiger', 282: 'version', 283: 'and', 284: 'is', 285: 'available', 286: 'in', 287: 'two', 288: 'editions', 289: 'according', 290: 'to', 291: 'apple', 292: 'leopard', 293: 'contains', 294: 'over', 295: 'changes', 296: 'and', 297: 'enhancements', 298: 'over', 299: 'its', 300: 'predecessor', 301:
источник

В

Владимир in Machine learning
'mac', 302: 'os', 303: 'x', 304: 'tiger', 305: 'as', 306: 'of', 307: 'mid', 308: 'some', 309: 'apple', 310: 'computers', 311: 'have', 312: 'firmware', 313: 'factory', 314: 'installed', 315: 'which', 316: 'will', 317: 'no', 318: 'longer', 319: 'allow', 320: 'installation', 321: 'of', 322: 'mac', 323: 'os', 324: 'x', 325: 'leopard', 326: 'since', 327: 'apple', 328: 'moved', 329: 'to', 330: 'using', 331: 'intel', 332: 'processors', 333: 'in', 334: 'their', 335: 'computers', 336: 'the', 337: 'osx', 338: 'community', 339: 'has', 340: 'developed', 341: 'and', 342: 'now', 343: 'also', 344: 'allows', 345: 'mac', 346: 'os', 347: 'x', 348: 'tiger', 349: 'and', 350: 'later', 351: 'releases', 352: 'to', 353: 'be', 354: 'installed', 355: 'on', 356: 'non', 357: 'apple', 358: 'x', 359: 'based', 360: 'computers', 361: 'os', 362: 'x', 363: 'mountain', 364: 'lion', 365: 'was', 366: 'released', 367: 'on', 368: 'july', 369: 'for', 370: 'purchase', 371: 'and', 372: 'download', 373: 'through', 374: 'apple', 375: 's', 376: 'mac', 377: 'app', 378: 'store', 379: 'as', 380: 'part', 381: 'of', 382: 'a', 383: 'switch', 384: 'to', 385: 'releasing', 386: 'os', 387: 'x', 388: 'versions', 389: 'online', 390: 'and', 391: 'every', 392: 'year', 393: 'apple', 394: 'has', 395: 'released', 396: 'a', 397: 'small', 398: 'patch', 399: 'for', 400: 'the', 401: 'three', 402: 'most', 403: 'recent', 404: 'versions', 405: 'of', 406: 'safari', 407: 'running', 408: 'on', 409: 'os', 410: 'x', 411: 'yosemite', 412: 'mavericks', 413: 'and', 414: 'mountain', 415: 'lion', 416: 'the', 417: 'mountain', 418: 'lion', 419: 'release', 420: 'marks', 421: 'the', 422: 'second', 423: 'time', 424: 'apple', 425: 'has', 426: 'offered', 427: 'an', 428: 'incremental', 429: 'upgrade', 430: 'rather', 431: 'than', 432: 'releasing', 433: 'a', 434: 'new', 435: 'cat', 436: 'entirely', 437: 'mac', 438: 'os', 439: 'x', 440: 'mountain', 441: 'lion', 442: 'installs', 443: 'in', 444: 'place', 445: 'so', 446: 'you', 447: 'won', 448: 't', 449: 'need', 450: 'to', 451: 'create', 452: 'a', 453: 'separate', 454: 'disk', 455: 'or', 456: 'run', 457: 'the', 458: 'installation', 459: 'off', 460: 'an', 461: 'external', 462: 'drive', 463: 'the', 464: 'fifth', 465: 'major', 466: 'update', 467: 'to', 468: 'mac', 469: 'os', 470: 'x', 471: 'leopard', 472: 'contains', 473: 'such', 474: 'a', 475: 'mountain', 476: 'of', 477: 'features', 478: 'more', 479: 'than', 480: 'by', 481: 'apple', 482: 's', 483: 'count'}
источник

В

Владимир in Machine learning
и все, на этом я завис
источник

A

Ana in Machine learning
лучше бы завис на три сообщения раньше
источник

В

Владимир in Machine learning
Пояснительную бригаду можно?
источник

I

Izya in Machine learning
Не стоит писать сюда весь вывод команды, это выглядит как спам и не несет никакой смысловой нагрузки)
источник

В

Владимир in Machine learning
ок, буду знать
источник

M

Maggie in Machine learning
По сути требуется матрица с подсчётом количества слов, где строки матрицы - предложения, а столбцы - слова.
источник