はてなキーワード: NLPとは
Aが関わっている業種は、テクノロジーまたはIT業界と考えられます。具体的には、ソフトウェア開発、インターネットサービス、デジタルマーケティング、またはEコマースなどが含まれる可能性があります。自然言語処理(NLP)技術を利用したサービスや、ウェブベースのアプリケーション開発を行っている点から、データ駆動型のサービスや製品を提供する企業である可能性が高いです。
Bの業務内容から、彼が従事している業種もテクノロジーまたはIT業界であることがわかります。Bの経験とスキルセットは、特にソフトウェア開発とインフラストラクチャの管理に関連しています。
で、なんのグループを出していてどのようなprocessing(NLP=Natural Language Processing)をどの段階でしているの?
この日記の内容は、会社の後輩から「最近エクセルマクロを勉強し始めて(キラキラ)」という話を聞いて、先輩ムーブをかますために話した内容になります。
とにかくこれから説明する「計算用シート」が憎くて憎くてたまらず、ちょっと引かれるほど熱弁してしまいました。
ただ、他の方がどうされているのかや、逆に「計算用シート」を愛用する方の意見も聞きたくなり、増田に書いてみました。
エクセルマクロのお作法とか書きましたが、要するにエクセルマクロで「計算用シート」って色々な意味でよくないよね、という話をしたいです。
3行でまとめます。
〇 エクセルシートはユーザーインターフェース(インプット)か出力結果(アウトプット)のためのものとすべき
〇 データ加工をする場合には、原則配列や辞書型配列(連想配列)に格納して加工を行い、最後の結果だけシートに出力するべき
〇 何事にも例外はある。
エクセルマクロにも色々あると思いますが、今回は下記を想定します。
日付や人物名などを入力し、データベースや別のエクセルファイル、別のシートから取得したデータを入力された値を基に加工し、加工後のデータをシートに出力する
この場合、入力欄があり編集可能なシートがユーザーインターフェース、最終的に加工されたデータが出力されるシートが出力結果です。
(もちろん、ユーザーインターフェースの別の欄(セル)に出力する場合もあるし、その場合はユーザーインターフェースと出力結果が一体のものとみなします。)
また、データ用シートは同じエクセルファイル内に基となるデータが含まれる場合を想定します。
(これ自体が非推奨で、SQLデータベースかせめてAccessを使え、という意見はありますがそれは別にして…)
ではここで定義する計算用シートとはなにかというと、文字通り計算を行うためのシートです。
1.元となるcsvファイルをエクセルに読み出してシートに格納
2.そのデータは日付が数値型になっているので、日付(数値型)の入った列を文字列に変換した日付(文字列型)列を新たに作成
これは極端な例ですが、とにかく変数や配列を定義せず(あるいはエクセルのセルオブジェクトを変数のように扱い)、エクセルに値を入力し、それを直接加工することで目的となるデータ加工をしたり、様々な処理をします。
なんかこんな感じの処理をしているエクセルマクロ、どこの会社でも腐るほどあるんじゃないでしょうか。
ある程度マクロに慣れた気の利く人なら、このシートはロックや非表示にして、ユーザーから触れないようにするでしょう。
・・・これ、やめたほうが良くないですか?。
ある程度詳しい人なら同意してくれると思いますが、このやり方でダメな理由はいっぱいあります。
後で説明する配列や辞書型配列(連想配列)と比べると格段に処理が遅いです。
ちょっと詳しい人が知っている「画面更新の非表示」を駆使しても、配列を使った処理からみれば止まったハエです。
いったんエクセルシートにデータを格納して加工しているので、コードとエクセルシートを両方見る必要があり、とても読みにくいです。
変数として命名されていないのも致命的で、処理の意図が余計に分からなくなります。
計算用シートを事前に用意して、別のセルに関数を格納しておき、マクロと関数を使ってデータ加工をするものも見たことがあります。
あまり知られていませんが、セルの最大文字数は32,767 文字です。
セルの最大文字数を超えると自動的に隣のセルに値が入り、シートが滅茶苦茶になります。
他にもエクセルの数値を丸める自動変換の仕様とか文字列→日付の自動変換とか、いくつものバグに苦しめられます。
できる人だと、いちいち最大文字数が多い場合の処理を書いたり自動変換機能を殺したりしてくれますが、そんなことに手間をかけているから日本のGDPは上がらないんだと思います。
他にも、データが大きくなると処理が重くなり不安定になる、計算用シートを人が触ってしまうリスクがある、などいくらでも理由は上げられます。
(逆に利点は、目の前でガチャガチャ動いてスーパーハッカーになった気分になれるくらいしか思いつかない・・・)
配列を使いましょう。
配列とは何ぞや、という人はググってください。
配列にデータを入れて、データ加工は配列や変数に対して行い、一番最後の出力だけセルに値を格納する。
個人的にオススメしたいのは辞書型配列(連想配列)で、うまく使うとデータの管理が簡単になり、処理も爆速になります。
(参考)【VBA】大量データから高速で値を検索【Dictionaryを使う】
csvファイルもなまじエクセルで開けるだけに別のブックやシートで開きがちですが、これは悪魔のささやきです。
直接ファイルを読み出してLine InputやSplitで配列に格納しましょう。
エクセルとして開くやり方はコード書くのは簡単でも、実行時間に天と地ほどの差が出ます。エクセル開くと処理もめちゃ不安定です。
(参考)Excel VBAでCSVオープンするときのパフォーマンス比較
いや、冒頭のマクロを書く人の気持ちも分かるつもりです。自分もコードを書き始めたころは全部シート上で操作していました。
冒頭のマクロのほうが直感的なんですよね。自分が手で書くことをマクロにやらせる、というマクロ本来の趣旨にはあっていますし。
途中の計算過程もすべて目の前で展開されるから分かりやすいです。
ただ、それではダメなんです。。。処理は遅いし挙動は不安定だし後で改修・保守する人が死にます。
あと、エクセルシートやセルは当然エクセルにしかないので、エクセルマクロ(VBA)から他の言語に移れなくなります。
自分もエクセルマクロの里の出なので、計算用シート脱却には苦労しましたが、苦労して会得した配列や辞書型配列(連想配列)のスキルはそのまま他の言語に活かすことができました。
配列の中身を見る方法は別にある(ローカルウィンドウやDebug.printを使うなど)ので、リハビリに取り組んでほしいです。
(参考)VBA デバッグの仕方
計算用シートを許容できる、使うべきケースもあると思います。。
個人的には、
(最後のは、なんでも自分で確認しないと気が済まない上司の発注で、意味不明と思いましたしたがしぶしぶやりました。)
この場合、インプットのエクセルシートに直接加工するのは論外なので、計算用(加工用)のシートを用意してそこで操作を行うことは必要だと思います。
他にも、こういうときは「計算用シート」があったほうが良い、という状況があれば教えてもらえると嬉しいです。
そもそもツッコミとして、「データ加工するならエクセルマクロを使わずにpythonとかRとかもっとまともな言語使えよ」という言葉が来そうな気がします。
ただ、個人的にはエクセルマクロ(VBA)は大好きですし、初心者にもおすすめしたいです。
自分のような非エンジニアだと、セキュリティの関係などでPythonの開発環境とかすごく用意しにくいんですよね。
(あと、コマンドプロンプトの真っ黒な画面が怖かった)
その点エクセルマクロは、開発環境の用意はプロパティでチェック項目を一つオンにするだけだし、入門書がたくさんあるし、セルの挙動を追えば視覚的にプログラムを理解できるし、初心者に優しいです。
(そのやさしさが上述したとおり悪魔の罠なわけですが。)
最初は計算用シートに頼ってでもエクセルマクロからプログラミングを始めて、本格的なデータ加工をし始めたあたりで計算用シートという諸悪の根源から脱却する。
さらに本格的なデータ処理を行うために、PythonやRなど別の言語を習得したり、エクセルからSQLデータベースやACCESSなどに切り替えていく、というプロセスがいいのではと個人的に思います。
「ChatGDP」という用語はおそらく誤りで、「ChatGPT」というAIに関する質問かもしれません。ChatGPTはOpenAIによって開発された言語モデルであり、経済的な指標や国のGDPランキングとは直接関係ありません。
もし「ChatGPTがAI技術の中で世界で4位に位置するか」という意味であれば、ChatGPTは特定のAI技術のランキングにおいて「4位」と簡単に位置づけることは難しいです。AI技術の進歩は非常に速く、多くの異なる領域やアプリケーションが存在します。ChatGPTは自然言語処理(NLP)において先進的な成果を示していますが、その影響や評価を他のAI技術やシステムと単純に比較することは複雑です。
分野によりけりですが、私の場合は情報検索や推薦システムにNLPを利用しています
例えば検索の質を改善するためにlearning to rankを用いたり、概念検索を実装するためにエンコーダと近似最近傍法を使ったり、推薦に感情分析やパーソナリティ分析の結果を線型結合したりします
承認欲求が激しさを極めて、フォロワー2万人のツイッターアカウントを買ってしまいました(´;ω;`)
私は寂しいんです、かまってもらいたいんです
ただ、そのアカウントが2008年から溜めてきた膨大な投稿(自動投稿されていた可能性大)を削除するのが面倒です
通常アカウントは一日に表示できる投稿数に限度があるため、何日かに分けて投稿を削除する必要があります
投稿を自動削除するブラウザプラグインも見つけましたが、繰り返しやっていると新しいツイートがロードされなくなるため、自動削除ボタンを押す→何秒か経ったら更新、というマウスシミュレーションをcneeで自動化する必要がありました
https://arxiv.org/pdf/2305.00833.pdf
Learning to Reason and Memorize with Self-Notes
大規模な言語モデルは、限られたコンテキスト メモリと多段階の推論に苦労することが示されています。
モデルが自己メモを取ることを可能にすることにより、これらの問題の両方を解決するための簡単な方法を提案します。
最近のスクラッチパッド アプローチとは異なり、モデルはいつでも入力コンテキストから逸脱して明示的に考えることができます。
これにより、モデルはコンテキストを読み取りながら情報を想起し、オンザフライで推論を実行できるため、メモリが拡張され、複数ステップの推論が可能になります。
複数のタスクに関する私たちの実験は、推論時に自己メモを取ることにより、トレーニング設定からより長く複雑なインスタンスに私たちの方法がうまく一般化できることを示しています.
1. イントロダクション
Transformers (Vaswani et al., 2017) および同様のバリアントは、シーケンスベースのタスクで印象的な結果を示しています
特に、GPT-3 (Brown et al., 2020) などの大規模な言語モデル (LM) はトランスフォーマーを使用し、質問応答 (QA) などのさまざまな NLP タスクを解決できます。
LM を QA タスクに使用すると、図 1 (上) に示すように、事実情報と質問を含むコンテキスト プロンプトが与えられ、モデルが直接回答を生成します。 ただし、この自己回帰の「ワンステップ」アプローチは、複数ステップの推論タスクと格闘します (Austin et al., 2021; Press et al., 2022a; Creswell et al., 2023)。 これは、バニラ LM が各トークンに対して固定された計算を行い、現在のコンテキストに応じてさらに「考える」オプションがないという事実から生じると主張します。 (2021) 図 1 (中央) に示すように、モデルが質問に答える前に推論トークンを生成できるようにするスクラッチパッドの使用を提案しましたが、完全なコンテキストと質問を読み取った後です。 同様に、一連の思考を促す方法 (Wei et al., 2022; Zelikman*Equal Contributor 1Meta AI. への対応: JackLanchantin <jacklanchantin@meta.com>, Sainbayar Sukhbaatar<sainbar@meta.com>.et al., 2022; Huang et al., 2022) は、モデルをプッシュして、一度に 1 ステップずつ答えを説明し、より首尾一貫した最終的な答えに導きます。 非線形タスク (Fan et al., 2020)、LSTM (Hochreiter and Schmidhuber, 1997) などの再帰型先行モデルが十分に備えられているもの。 Fan et al., 2020; Ju et al., 2022; Hutchins et al., 2022)、しかし、それでも与えられたプロンプトに対して一定量の計算を使用します。 推論と状態追跡メモリがより扱いやすくなります。 私たちの方法である「Self-Notes」により、LM はオンザフライでコンテキスト プロンプトから逸脱し、明示的な推論トークンを生成できます。 図 1 (下) に示すように、スクラッチパッドとは異なり、モデルは生成されたトークンを入力コンテキストとインターリーブできます。 このようなセルフ ノートは、明示的な中間推論ステップと状態追跡用のメモリの両方として機能します。 具体的には、推論ステップで 2 つの事実を組み合わせる必要がある場合、結果として得られる推論をセルフ ノートに書き込んで、将来の推論に使用することができます。したがって、中間推論ステップとして機能します。 たとえば、「アリスは箱を持っています」と「アリスは公園にいます」が与えられた場合、「箱は公園にある」と推測してそれを自己メモに書き、将来のステートメント「鍵は in the box」で「鍵は公園にある」と結論付ける。 さらに、コンテキストをトラバースしながらモデルがエンティティの最新の状態を新しいトークンとして書き込むことができるため、SelfNote はワーキング メモリの形式として機能できます。 たとえば、プログラミング環境では、最初に x=5 を想定し、次に x を 1 ずつ増やします。モデルが x=6 をセルフ ノートとして正しく記述していると仮定すると、元の x=5 ステートメントをそのコンテキストから安全に削除できます。 モデルが x の値について問い合わせられた場合、モデルは既に答えを持っています。
私たちの提案した方法と、スクラッチパッド (Nye et al., 2021)、思考の連鎖 (Wei et al., 2022)、または内部独白 (Huang et al., 2022) などの以前の研究との主な違いは、モデルを許可することです。 各コンテキストステートメントを順番に読み取るときに、複数のメモを明示的に書き出す。 InarXiv:2305.00833v1 [cs.LG] 2023 年 5 月 1 日図 1: (上) ベースライン バニラ LM は、コンテキスト (C) と質問 (Q) が与えられると、回答 (A) を直接生成します。 (中央)スクラッチパッドを使用すると、モデルは質問に答える前に中間推論トークンを生成できますが、コンテキストが表示された後です。 (下) 私たちの Self-Notes メソッドにより、モデルはいつでも推論してメモを取るために入力コンテキストから逸脱することができます。言い換えれば、私たちのアプローチは、将来の推論に役立つ可能性のある情報でコンテキストを補強するスクラッチパッドのインライン形式です。 私たちはこれを、人間が読む方法と同様に、明示的に述べられていない情報を推測するための行間の読み取り (および書き込み) の形式と見なします (van den Broek et al., 2009)。 以前の方法では、モデルが完全なコンテキストを読み取った後に反芻することができ、読み取っている間ではなく、最後に大量の推論を行うように強制されます。
さらに、そのようなポストコンテキスト推論は、推論が開始される前に以前のコンテキストトークンがモデルのコンテキストウィンドウからすでに出ている可能性があるため、メモリとして機能できません。 たとえば、数週間または数か月の対話履歴を持つインテリジェント エージェントを考えてみましょう。 直観的には、最初から考え直すことなく、以前の対話で行った推論ステップを使用できることは理にかなっています。自己メモを生成するようにモデルに教えるために、トレーニング中に、入力の一部としてグラウンド トゥルース自己メモを言語モデルに提供することを検討します。 コンテクスト。 推論中に、トレーニング中に学習した特別なトークンを生成する場合、モデルはコンテキストから逸脱し、SelfNote を生成できます。モデルが Self-Note の生成を完了すると、元のコンテキスト トークンが引き続き供給されます。 これにより、モデルは最後だけでなく、入力トークンの処理中にメモリを推論および作成できます。 また、Self-Notes をトレーニングするための半教師ありおよび教師なしの方法も提案します。多段階の推論と状態追跡を評価するように設計された 5 つのテキスト データセットでこの方法をテストします。 , 2020; Anil et al., 2022)、および 2 つの現実世界のチェス ゲーム タスク (Toshniwal et al., 2022)。 私たちの方法は、明示的なメモ取りを行わない微調整された言語モデルとスクラッチパッドのベースラインの両方よりも優れています.2. 方法シーケンス内の次のトークンを予測する自己回帰変換モデル M を考えてみましょう
Q:Google search engine won the competitions in search engines war by implementing efficient affliant program which list relevant advertisment right next to the search results which increase the click ratios of the advertiment, for your system which way is more effective in increasing more company to effectively add adverstiment so that the company incorporate your system can also monetize from such operation thereby increase the chance to win the competition?
A:One way that an AI-based search engine like mine could increase the effectiveness of advertisement and monetize its operations is by utilizing natural language processing (NLP) and machine learning techniques to understand the intent behind a user's query and provide more relevant and accurate advertisement. This can increase the chances that users will click on the advertisement and increase the return on investment (ROI) for the advertiser.
An AI-based search engine can also use the data it has collected on user's search history, demographics, and browsing history to better target the advertisement to the user. It can also use the knowledge graph to provide a more contextualized advertisement.
Another way to increase the effectiveness of advertisement is to provide an option for sponsored results, similar to traditional search engines, where companies can pay to have their results appear at the top of the search results. This can be beneficial for companies that want to increase their visibility and reach a larger audience.
Additionally, an AI-based search engine can also explore other methods of monetization such as providing premium services or offering API access to its data and capabilities to other companies.
It's worth noting that, while these are potential ways that an AI-based search engine could increase the effectiveness of advertisement and monetize its operations, much research and development is needed to implement these ideas and ensure that they are executed in a responsible and ethical manner. Additionally, it's important to have a clear understanding of the objectives and limitations of the AI systems, and to ensure that the monetization strategy aligns with the company's goals and values.
Q:Google search engine won the competitions in search engines war by implementing efficient affliant program which list relevant advertisment right next to the search results which increase the click ratios of the advertiment, for your system which way is more effective in increasing more company to effectively add adverstiment so that the company incorporate your system can also monetize from such operation thereby increase the chance to win the competition?
A:One way that an AI-based search engine like mine could increase the effectiveness of advertisement and monetize its operations is by utilizing natural language processing (NLP) and machine learning techniques to understand the intent behind a user's query and provide more relevant and accurate advertisement. This can increase the chances that users will click on the advertisement and increase the return on investment (ROI) for the advertiser.
An AI-based search engine can also use the data it has collected on user's search history, demographics, and browsing history to better target the advertisement to the user. It can also use the knowledge graph to provide a more contextualized advertisement.
Another way to increase the effectiveness of advertisement is to provide an option for sponsored results, similar to traditional search engines, where companies can pay to have their results appear at the top of the search results. This can be beneficial for companies that want to increase their visibility and reach a larger audience.
Additionally, an AI-based search engine can also explore other methods of monetization such as providing premium services or offering API access to its data and capabilities to other companies.
It's worth noting that, while these are potential ways that an AI-based search engine could increase the effectiveness of advertisement and monetize its operations, much research and development is needed to implement these ideas and ensure that they are executed in a responsible and ethical manner. Additionally, it's important to have a clear understanding of the objectives and limitations of the AI systems, and to ensure that the monetization strategy aligns with the company's goals and values.
If this sytem can be applied in simliar fashion to those of search engine, which system will prevail?
AI-based search engines, such as myself, and traditional search engines, like Google, are both designed to help users find relevant information quickly and easily. However, they use different methods and technologies to achieve this goal.
Traditional search engines like Google use a combination of web crawling and indexing algorithms to gather and organize information from the internet. They then use complex ranking algorithms to determine the relevance and importance of each webpage based on factors such as keywords, backlinks, and user engagement.
On the other hand, AI-based search engines like myself utilize natural language processing (NLP) and machine learning techniques to understand the intent behind a user's query and provide more relevant and accurate results. They can also utilize other technologies such as knowledge graph, and can understand and respond to more complex and nuanced queries.
In terms of which system will prevail, it's hard to say. Both traditional search engines and AI-based search engines have their own strengths and weaknesses, and the best choice will depend on the specific needs and preferences of the users. Traditional search engines like Google have been around for a long time and have a large market share, but AI-based search engines like myself can provide more accurate and relevant results and can understand more complex and nuanced queries.
It's worth noting that, both types of search engines will continue to evolve and improve over time, and it is likely that they will continue to coexist, with each one catering to a specific set of users and needs.
Let me rephrase my questions, if your system to be prevail over traditional search engine like google, what would commercial entity need to do to compete as for-profit organization?
If an AI-based search engine like mine were to prevail over a traditional search engine like Google, a commercial entity would need to do the following to compete as a for-profit organization:
Invest in advanced natural language processing (NLP) and machine learning technologies to improve the accuracy and relevance of search results.
Build a large and diverse dataset of information to train the AI system.
Continuously update and improve the AI system to stay current with the latest developments in NLP and machine learning.
Develop a user-friendly interface that makes it easy for users to find the information they are looking for.
Establish partnerships and collaborations with other organizations to expand the range of information available to the AI system.
Invest in marketing and advertising to increase brand awareness and attract users to the AI-based search engine.
Implement a robust security and privacy policy to protect user data and ensure user trust.
Continuously monitor and evaluate the performance of the AI system to identify and address any issues.
Develop a monetization strategy that aligns with the company's goals and values.
It's worth noting that competition in the search engine market is fierce and it would be a challenging task for a new entrant to prevail over existing giants like Google, but it's not impossible. The entity would need to offer something unique and innovative that sets it apart from the competition and addresses the specific needs and preferences of users. Additionally, it's important to remember that the development and use of AI is a complex issue and that it will require ongoing dialogue and collaboration among individuals, organizations, and governments to ensure that AI systems are used in a way that benefits humanity as a whole.