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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #22 · 19 јан.

Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic

Hashtags

Резултати

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

Пребарај: #copyrightlawsuit

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

@ai_and_law · Post #174 · 27.11.2023 г., 08:04

OpenAI Faces Fifth Copyright Lawsuit Over AI Models Greetings AI & Law Community! OpenAI finds itself entangled in a fifth copyright lawsuit, with Microsoft also implicated. Filed by US writer Julian Sancton, the lawsuit alleges a blatant disregard for copyrights in training AI models, specifically ChatGPT. Julian Sancton, a New York Times best-selling author, spent five years and extensive resources researching and writing "Madhouse at the End of the Earth." This lawsuit represents him and other writers who feel their work has been misused. The crux of the matter is OpenAI and Microsoft using copyrighted works without compensating or seeking permission from authors. The lawsuit contends that these companies not only reproduced millions of works but also built a model that mimics the style and themes of these copyrighted materials. Unlike previous lawsuits against OpenAI, this one includes Microsoft as a defendant. The claim suggests a close collaboration between the two companies in creating and monetizing AI models like GPT-3 and GPT-4, which underpin various Microsoft services. The plaintiffs demand compensation for their work and seek a court order prohibiting OpenAI and Microsoft from training their models by infringing on copyrighted material. This marks the fifth lawsuit against OpenAI by writers, emphasizing a growing legal concern within the AI community. #AILaw#CopyrightLawsuit#OpenAI#Microsoft#AICommunity

AI & Law

@ai_and_law · Post #273 · 29.03.2024 г., 08:04

Bloomberg Asserts Fair Use Defense in AI Copyright Lawsuit Bloomberg LP has moved to dismiss a lawsuit from Arkansas governor Mike Huckabee and other authors, arguing that its use of copyrighted works for AI research falls within the bounds of fair use. The authors, including best-selling Christian writer Lysa TerKeurst, allege that Bloomberg misused their books to train its AI system without permission. Bloomberg contends that the authors' claims lack specificity regarding infringement and which books were utilized for BloombergGPT, describing the system as an internal research project. In its filing, Bloomberg emphasized that its use of copyrighted material was limited, private, and not for commercial purposes, asserting that such use does not constitute copyright infringement. The lawsuit is part of a broader trend where copyright holders challenge tech companies over alleged misuse of content for training AI models. Bloomberg's fair use defense is expected to be pivotal in this dispute. #Bloomberg#CopyrightLawsuit#FairUse#AIResearch

AI & Law

@ai_and_law · Post #161 · 10.11.2023 г., 08:04

Artist Lawsuit Over AI Image Generators Faces Challenges Hello, dear subscribers! In the ongoing lawsuit against AI image generators by artists, several claims were dismissed by US district Judge William H. Orrick. Notably, two of the three plaintiffs in the case had not registered their disputed works with the Copyright Office, leading to the dismissal of their claims. However, the lead plaintiff, Sarah Andersen, has 30 days to amend her complaint and continue the copyright dispute. The artists allege that AI image generators infringe on their copyrights, claiming direct and vicarious infringement, violations of the Digital Millennium Copyright Act, and California laws related to unfair competition and rights to publicity. They argue that AI-generated images should be considered derivative works based on copyrighted content. While the case proceeds, the judge has called for clarification on how image generators work, especially regarding "compressed copies" of images and the operation of AI systems like Stable Diffusion. The lawsuit remains complex, with the core claim of direct copyright infringement proceeding against Stability AI but not against DeviantArt and Midjourney. The artists will need to address the many issues identified in their claims, including specifics regarding copyright management information and rights of publicity. #AIImageGenerators#CopyrightLawsuit#AIandArt#LegalAction