いい機会だし先日投稿したスペクトラルクラスタリングとやらを実際にやってみたいと思います。ソースコードは再生産しても仕方がないのですぐる様のブログからパクってお借りします。 すぐる様のブログにあったコードはそのままではうまく動作しなかったのと、Jupyter notebook のお作法に従って少しコードを手直ししています。(そのまま実行するとGraph is not fully connected, spectral embedding may not work as expected.というwarningが表示されました。このwarningに関してもGitHubのissueに素晴らしい回答があるのですが読むのが面倒臭かったので@taki__taki__様のブログよりスペクトラルクラスタリングの実行部分のコードを1行だけお借りしました。また、%matplotlib inlineはimport
Published: 2023-11-01 Last Updated: 2023-11-01 06:33:33 UTC by Xavier Mertens (Version: 1) Did you ever seen ZPAQ archives? This morning, my honeypot captured a phishing attempt which lured the potential victim to open a "ZPAQ" archive. This is not a common file format. This could be used by the attacker to bypass classic security controles. What Wikiepadia says about ZPAQ: ZPAQ is an open source
GPT-2 Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in this paper and first released at this page. Disclaimer: The team releasing GPT-2 also wrote a model card for their model. Content from this model card has been written by the Hugging Face tea
「gpt2-japanese」の「smallモデル」と「ファインチューニングのコード」が公開されたので、日本語によるGPT-2のファインチューニングを試してみました。 前回 (1) Google Colabのノートブックを開く。 (2) メニュー「編集→ノートブック→ハードウェアアクセラレータ」で「GPU」を選択。 (3) 以下のコマンドで、「gpt2-japanese」をインストール。 # gpt2-japaneseのインストール !git clone https://github.com/tanreinama/gpt2-japanese %cd gpt2-japanese !pip uninstall tensorflow -y !pip install -r requirements.txt2. モデルのダウンロード「smallモデル」を「gpt2-japanese」フォルダにダウン
Any day that you see one of your projects make it to public release is a good day, and today is a damn good day. Today I introduce the world to CertStream — a free service and simple libraries for getting data from the Certificate Transparency Log (CTL) network in real time. This allows anyone to write extremely simple code (or even a bash script) to react to SSL certificates being issued, as they
Support us Creating and maintaining this service takes a lot of time. I would appreciate if you could donate a few bucks. Is your favicon perfect? Let us give a look. We check more than a dozen settings to make sure it fits all major platforms. Here are a few questions you may have: Is my favicon.ico correct? This simple question often raises surprising answers... Does my favicon look good on iOS?
ホストの調査に便利なnmapですが、スクリプト言語から使えたら便利です。 Pythonにはnmapのモジュールが用意されています。 そこでPython+nmapでポートスキャンをしてみましょう。 モジュールのインストール pipでモジュールをインストールすることができます。 pip install python-nmap スキャン nmapパッケージがPortScannerを持っています。 インスタンスを作りスキャンを実行できます。 import nmap ps = nmap.PortScanner() # scan port 1 to 65535 ps.scan('192.168.11.11','1-65535', '-sSV') オブジェクトのscanメソッドの第三引数にはフラグを指定できます。 フラグはシェルコマンドのnmapと同じもので大丈夫です。 今回はSYN Scanを指定して
「Pythonでグラフデータベース Neo4j入門 for ビギナー」とか銘打っておきながら私自身もビギナーなので、すみません。 PythonでNeo4jを操作する環境構築と、データをいじってみるサンプルをご紹介します。 1. Neo4jの導入 まず、Mac OSXにNeo4Jを導入する方法から始めます。私の環境がYosemite 10.10.2なのでもし環境違いで何かエラー等あればコメント等で教えていただけると嬉しいです。 まず、JDKが必要ですが、Macに最初から入っているJavaではうまく動かないそうなので Oracle JDK 7を http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html から導入します。 次に、 http://neo4j.com/download/ にア
ネットワーク分析する際は、いつもjavascriptかpythonでnodeとedigeのjsonファイル(または.dotファイル)を作成してから、gephiを利用していたけど、pythonで完結できないかと思って検討した結果。 タイトルのとおり、pythonの3つのライブラリを連携させれば楽にネットワーク分析&可視化までできる。 中心となるnetworkxさまさま。おかげで苦労してきたデータ作成や出力などが一気に楽になった。 1.ネットワーク元のデータ やはりpandasの利用。 networkxのドキュメントに「from_pandas_edgelist」という関数がある。 Parameters df (Pandas DataFrame) – An edge list representation of a graph source (str or int) – A valid colu
まえがき Pythonを使えばテキストを含むPDFの解析は簡単だ・・・ 文字情報が含まれていればPDFから文字やテーブルの情報を抽出して、そのデータを利用してWebサービスなんて簡単につくれるぜ、ひゃっほーいっという安易な思考の結果が以下になります。 新型コロナウイルス感染症の感染拡大を踏まえたオンライン診療のPDFデータを利用してみた https://qiita.com/mima_ita/items/c0f28323f330c5f59ed8 ここで得た最も重要な知見は「PDFデータをコンピュータで読むのはやめとけ、あれは人間が読むものだ」ということと、わずかなPythonを使用したPDFの取り扱いの方法です。 今回はそのわずかなPythonを使用したPDFの取り扱い方法について説明します。 なお、実験環境はWindow10のPython 3.7.5 64bitになります。 operand
class Levenshtein: #ここで配列を立ち上げて、初期値を入れる def initArray(self,str1,str2): distance = [] for i in range(len(str1)+1): distance.append([0]*(len(str2)+1)) distance[i][0] = i for j in range(len(str2)+1): distance[0][j] = j return distance #セルに値を入れる def editDist(self,str1,str2,distance): dist = [0]*3 for i in range(1,len(str1)+1): for j in range(1,len(str2)+1): dist[0] = distance[i-1][j-1] if str1[i-1]==s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く