Skip to content

Instantly share code, notes, and snippets.

View proger's full-sized avatar
🎯
Focusing

Volodymyr Kyrylov proger

🎯
Focusing
View GitHub Profile
To improve the classification of statements as false positives in the Bandwagon (Appeal to People) category, it is important to establish clear guidelines to differentiate between genuine bandwagon appeals and statements that may not fit this classification. Here are the revised guidelines:
### Guidelines for Classifying Bandwagon Examples
1. **Identify Collective Action**:
- Look for phrases that explicitly encourage individuals to conform to behavior or opinions that a majority or a specified group supports. Words like "everyone," "all," "most," or "together" are strong indicators of a bandwagon appeal.
- Example: “Join everyone who is supporting the army this way!”
2. **Avoid Contextual Statements**:
- Statements that share factual information, personal experiences, or non-persuasive narratives should not be classified as bandwagon appeals. For instance, reporting on the number of participants in an event without encouraging others to join doesn’t qualify.
@proger
proger / manipulations.md
Last active January 18, 2025 20:24
UNLP 2025 Shared Task on Detecting Social Media Manipulation (reformatted from techniques_description.pdf)

The dataset was provided by the Texty.org.ua team. It consists of Ukrainian Telegram posts annotated for the presence of ten manipulation techniques. The annotation was performed by experienced journalists, analysts, and media professionals. Detailed explanations and examples of manipulation techniques are available below.

In this task, your goal is to identify manipulation techniques in Ukrainian social media content (specifically, Telegram). In this context, “manipulation” refers to the presence of specific rhetorical or stylistic techniques aimed to influence the audience without providing clear factual support.

Given the text of a post, identify which manipulation techniques are used, if any. This is a multilabel classification problem; a single post can contain multiple techniques.

Each of the ten labels and particular examples with explanations are

"""
DeltaNet implementation reference for Accelerated Scan. DeltaNet performs efficient management of a large fixed-sized memory.
For a simple single chunk version see `forward_simple`.
It computes decayed values by a little bit of recurrence (`decay_values`)
and then applies linear attention (`causal_attend`).
`forward_chunkwise` is inspired by Yang 2024. It applies single chunk version pointwise and
then performs chunk-level stitching.
digit 10076 27
digit 10154 2011
digit 1017 4
digit 10191 33
digit 1025 5
digit 10353 31
digit 10389 2008
digit 10411 120
digit 10607 01
digit 10858 195
"""
Randomized Binary Search Trees
https://www.cs.upc.edu/~conrado/research/papers/jacm-mr98.pdf
"""
import math
import random
from collections import Counter
class root:
"""
DeltaNet implementation reference for Accelerated Scan. DeltaNet performs efficient management of a large fixed-sized memory.
`forward` is inspired by Yang 2024. It applies single chunk version pointwise and then performs chunk-level stitching.
`forward_loop` is the reference implementation of the original recurrence.
References:
[1] The WY Representation for Products of Householder Matrices (Bischof and Van Loan 1985)
Method 1, section 3 guides `decay_values`.
// uses https://github.com/HazyResearch/ThunderKittens
#include "tk/src/kittens.cuh"
#include "tk/src/common/pyutils/torch_helpers.cuh"
#define NUM_WORKERS 2 // This kernel uses this many workers in parallel per block, to help issue instructions more quickly.
#define DIMENSION 64 // This kernel operates over 64-dimensional vectors
#define DEBUG 0
using namespace kittens; // this kernel only handles headdim=q_reg.cols for simplicity. Also n should be a multiple of 256 here.
"a linear RNN that receives ones as input and gives increasingly better approximations to pi as output"
import numpy as np
import math
def binary(digits: int):
"Make a basis of powers of two of dimension `digits`, lowest bits first"
return 1 << np.arange(digits)
def leibniz(n):
#%%
import math
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
plt.rcParams['axes.spines.left'] = False
plt.rcParams['axes.spines.right'] = False
plt.rcParams['axes.spines.top'] = False
@proger
proger / tpr.py
Last active August 30, 2024 22:58
tensor product representation capacity
#%%
from collections import defaultdict
import bisect
import json
import matplotlib.pyplot as plt
import torch
from matplotlib import rcParams
rcParams['font.family'] = 'serif'