TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #65 · 8 апр.

Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex

Резултати

Пронајдени 1 слични објави

Пребарај: #surveillancetech

当前筛选 #surveillancetech清除筛选
AI & Law

@ai_and_law · Post #784 · 13.03.2026 г., 07:04

👓Report Raises Privacy Concerns Over Data Annotation for Meta Smart Glasses A media investigation reports that workers reviewing data for Meta have watched sensitive footage recorded by Ray-Ban Meta smart glasses, including videos showing people in private situations such as using the bathroom or changing clothes. The report is based on interviews with more than 30 employees of Sama, a contractor from Kenia providing data annotation services for Meta’s AI systems. According to interviewed workers, some videos captured by the smart glasses showed intimate scenes, including people having sex or partners leaving bathrooms unclothed. The investigation was conducted by Svenska Dagbladet, Göteborgs-Posten, and journalist Naipanoi Lepapa. Employees cited in the report said reviewing such content created discomfort but was part of their assigned annotation work. The report describes a continuous flow of potentially privacy-sensitive material being processed for training and improving Meta’s AI systems. Meta confirmed that content shared with its AI services may be reviewed by contractors to improve user experience. According to the company’s privacy policies, photos, videos, voice recordings, and transcripts generated through interactions with Meta AI or cloud processing on its smart glasses may be analyzed using machine learning and human reviewers, including third-party vendors. #AIPrivacy#DataAnnotation#AIGovernance#AIethics#SurveillanceTech#WearableAI#PlatformResponsibility