新手上路,翻译不恰之处,恳请指出,不胜感谢

Updated log

1st:2011/8/5

2nd:2011/8/6

3rd:2012/5/14

每次按一小节来分,本篇涉及第一章的1.1,除了最后的小节&扩展阅读&习题放在一篇博客内。

CHAPTER 1 第一章

Language Processing and Python 语言处理和Python

It is easy to get our hands on millions of words of text. What can we do with it, assuming we can write some simple programs? In this chapter, we’ll address the following questions:

我们可以轻松地获得上百万字的文本。假设我们会写一些简单的程序 ,那我们可以对它来做些什么呢?本章我们将解决以下几个问题:

1. What can we achieve by combining simple programming techniques with large quantities of text?

通过简单的编程技术对大量的文本合并,我们能实现什么?

2. How can we automatically extract key words and phrases that sum up the style and content of a text?

我们如何自动地提取关键字和词组来总结文本的风格和内容?

3. What tools and techniques does the Python programming language provide for such work?

Python编程语言为这些工作提供了什么工具和技术?

4. What are some of the interesting challenges of natural language processing?

自然语言处理有哪些有趣的挑战呢?

This chapter is divided into sections that skip between two quite different styles. In the“computing with language” sections, we will take on some linguistically motivated programming tasks(语言相关的编程任务) without necessarily explaining how they work. In the “closer look at Python” sections we will systematically review key programming concepts. We’ll flag(标志) the two styles in the section titles, but later chapters will mix both styles without being so up-front (显著的)about it. We hope this style of introduction gives you an authentic taste(原味) of what will come later, while covering a range of elementary concepts in linguistics and computer science. If you have basic familiarity with both areas, you can skip to Section 1.5; we will repeat any important points in later chapters, and if you miss anything you can easily consult the online reference material at http://www.nltk.org/. If the material is completely new to you, this chapter will raise more questions than it answers, questions that are addressed in the rest of this book.

  本章分为完全不同风格的两部分。 在 “ 语言计算 ” 部分,我们将进行一些语言相关的编程任务而不去解释它们是如何实现的。 在 “ 细看Python ” 部分 , 我们将系统地回顾关键的编程概念 。 我们 使用章节标题来区分这两种风格,而后面几章将混合两种风格而不作明显地区分。我们希望这种介绍方式可以使你对接下来将要接触的内容有一个真实的体味 ,与此同时,涵盖语言学与计算机科学的基本概念。如果你对这两个方面已经有了基本的了解,可以跳到 1.5 节。我们将在后续的章节中重复所有要点,如果错过了什么 , 你可以很容易地在 http://www.nltk.org/ 上查询在线参考材料。如果这些材料对你而言是全新的,那么本章将产生的问题比它所解答的问题更多,这些问题将在本书的其余部分讨论。

1.1 Computing with Language: Texts and Words 语言计算:文本和单词

We’re all very familiar with text, since we read and write it every day. Here we will treat text as raw data for the programs we write, programs that manipulate and analyze it in a variety of interesting ways. But before we can do this, we have to get started with the Python interpreter.

我们都对文本非常熟悉,因为我们每天都进行阅读和写作。 在这里 ,我们将文本作为我们编写的程序的原始数据,我们将以很多有趣的编程方式来处理和分析文本。但在我们能能进行这些工作前,我们必须得从 Python 解释器开始。

Getting Started with Python Python入门(不会Python的童鞋,去找本入门的书看看,上手很快)

One of the friendly things about Python is that it allows you to type directly into the interactive interpreter—the program that will be running your Python programs. You can access the Python interpreter using a simple graphical interface called the Interactive DeveLopment Environment (IDLE). On a Mac you can find this under Applications→MacPython, and on Windows under All Programs→Python. Under Unix you can run Python from the shell by typing idle (if this is not installed, try typing python). The interpreter will print a blurb about your Python version; simply check that you are running Python 2.4 or 2.5 (here it is 2.5.1):

Python 对用户友好的一个特性是你可以在交互式解释器直接输入代码—— 解释器将运行你的Python程序。你可以通过一个称为交互式开发环境( Interactive DeveLopment Environment,简称IDLE)的简单图形接口来访问 Python 解释器。在Mac上,你可以在“ 应用程序 → MacPython ”中找到;在 Windows 中,你可以在“ 程序 → Python ” 中找到。在Unix 下,你可以在 shell 输入“ idle ”来运行 Python(如果没有安装,尝试输入 python )。解释器将会输入关于你的 Python 的版本简介,请检查你是否运行在 Python 2.4 或 2.5 (这里是2.5.1,个人推荐大家用2.7,老库基本可用) :

Python 2.5 . 1 (r251: 54863 ,Apr 15 2008 , 22 : 57 : 26 )

[GCC
4.0 . 1 (AppleInc.build 5465 )]ondarwin

Type"help","copyright","credits"or"license"formoreinformation.
>>>

更多相关文章

  1. python自然语言处理——3.8 分割
  2. python 读写文本文件
  3. Python语言及其应用 PDF
  4. Python自然语言处理实践: 在NLTK中使用斯坦福中文分词器
  5. Matplotlib:中心文本在其bbox。
  6. 支持c和python之间的跨语言(c)标记的代码编辑器
  7. 不同程序语言之间的互动,IronPython 与C#交互
  8. Python语言特性之1:函数参数传递
  9. 运用Python语言编写获取Linux基本系统信息(三):Python与数据库编

随机推荐

  1. Node.js 事件循环完整指南[每日前端夜话0
  2. JavaScript 进阶问题列表[每日前端夜话0x
  3. 【python】虚拟环境搭建
  4. 美国终于挥舞着霸权大棒向程序员动手了
  5. 【python】使用pip提示ModuleNotFoundErr
  6. JavaScript的前景与未来[每日前端夜话0x9
  7. 回到基础:JavaScript API[每日前端夜话0xA
  8. C语言学习心得(六)
  9. 什么是Deno,它与Node.js有什么不同?[每日前
  10. 成为优秀程序员的101条准则[每日前端夜话